Apply code style

This commit is contained in:
Shift
2023-05-24 21:36:42 +00:00
parent 41147b26f2
commit c6c639afc2
7 changed files with 38 additions and 32 deletions

View File

@@ -53,7 +53,10 @@ class OCRController extends ApiController
curl_setopt($ch, CURLOPT_BUFFERSIZE, 128); // more progress info curl_setopt($ch, CURLOPT_BUFFERSIZE, 128); // more progress info
curl_setopt($ch, CURLOPT_NOPROGRESS, false); curl_setopt($ch, CURLOPT_NOPROGRESS, false);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function ( curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function (
$downloadSize, $downloaded, $uploadSize, $uploaded $downloadSize,
$downloaded,
$uploadSize,
$uploaded
) use ($maxDownloadSize) { ) use ($maxDownloadSize) {
return ($downloaded > $maxDownloadSize) ? 1 : 0; return ($downloaded > $maxDownloadSize) ? 1 : 0;
}); });
@@ -99,7 +102,6 @@ class OCRController extends ApiController
$result = ''; $result = '';
$img = imagecreatefromstring($curlResult); $img = imagecreatefromstring($curlResult);
if ($img !== false && (($options !== null && imagefilter($img, $filter, $options) === true) || ($options === null && imagefilter($img, $filter) === true))) { if ($img !== false && (($options !== null && imagefilter($img, $filter, $options) === true) || ($options === null && imagefilter($img, $filter) === true))) {
ob_start(); ob_start();
imagepng($img); imagepng($img);
$imgData = ob_get_contents(); $imgData = ob_get_contents();
@@ -192,7 +194,7 @@ class OCRController extends ApiController
$command = escapeshellcmd($cmd); $command = escapeshellcmd($cmd);
$output = shell_exec($cmd); $output = shell_exec($cmd);
if ($output !== null && strlen($output) > 0) { if ($output !== null && strlen($output) > 0) {
$output = substr($output, strpos($output, '----------START----------') + 25); $output = substr($output, (strpos($output, '----------START----------') + 25));
} else { } else {
$output = ''; $output = '';
} }

View File

@@ -35,7 +35,8 @@ class SubscriptionController extends ApiController
return $this->respondAsResource( return $this->respondAsResource(
$collection, $collection,
['isCollection' => true, ['isCollection' => true,
'appendData' => ['total' => $total]] 'appendData' => ['total' => $total]
]
); );
} }

View File

@@ -21,6 +21,7 @@ class Permission extends Model
'user', 'user',
]; ];
/** /**
* Get the User associated with this model * Get the User associated with this model
* *

View File

@@ -1,4 +1,5 @@
<?php <?php
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase; use Tests\TestCase;
@@ -6,6 +7,7 @@ class ContactFormTest extends TestCase
{ {
use RefreshDatabase; use RefreshDatabase;
public function testContactForm() public function testContactForm()
{ {
$formData = [ $formData = [