Applied PHP-CS-Fixer rules

This commit is contained in:
Bernd Bestel
2020-09-01 21:29:47 +02:00
parent 3da8904cba
commit 836bcc82e5
56 changed files with 150 additions and 467 deletions

View File

@@ -1,6 +1,6 @@
<?php
use \Grocy\Helpers\BaseBarcodeLookupPlugin;
use Grocy\Helpers\BaseBarcodeLookupPlugin;
/*
This class must extend BaseBarcodeLookupPlugin (in namespace \Grocy\Helpers)
@@ -55,24 +55,24 @@ class DemoBarcodeLookupPlugin extends BaseBarcodeLookupPlugin
*/
protected function ExecuteLookup($barcode)
{
if ($barcode === 'x') // Demonstration when nothing is found
{
if ($barcode === 'x')
{ // Demonstration when nothing is found
return null;
}
elseif ($barcode === 'e') // Demonstration when an error occurred
{
elseif ($barcode === 'e')
{ // Demonstration when an error occurred
throw new \Exception('This is the error message from the plugin...');
}
else
{
return array(
return [
'name' => 'LookedUpProduct_' . RandomString(5),
'location_id' => $this->Locations[0]->id,
'qu_id_purchase' => $this->QuantityUnits[0]->id,
'qu_id_stock' => $this->QuantityUnits[0]->id,
'qu_factor_purchase_to_stock' => 1,
'barcode' => $barcode
);
];
}
}
}