Skip to content

Commit

Permalink
Merge pull request #176 from mehdi-fathi/analysis-nNwbG1
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
mehdi-fathi authored Jul 29, 2021
2 parents 87e5057 + 4cbbf3a commit 1ba8532
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/QueryFilter/Core/IoTrait.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?php


namespace eloquentFilter\QueryFilter\Core;


trait IoTrait
{
/**
* @param $out
*
* @return mixed
*/
private function __handelResponseFilter($out)
Expand Down
6 changes: 2 additions & 4 deletions src/QueryFilter/Core/QueryFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
use eloquentFilter\QueryFilter\Detection\DetectionFactory;

/**
* Class QueryFilter
* @package eloquentFilter\QueryFilter\Core
* Class QueryFilter.
*/
class QueryFilter
{
Expand Down Expand Up @@ -61,7 +60,7 @@ class QueryFilter
/**
* QueryFilter constructor.
*
* @param array $request
* @param array $request
* @param array|null $detect_injected
*/
public function __construct(?array $request, array $detect_injected = null)
Expand Down Expand Up @@ -180,5 +179,4 @@ protected function getDetectorFactory(array $default_detect = null, array $detec

return app(DetectionFactory::class, ['detections' => $this->getDetections()]);
}

}
4 changes: 2 additions & 2 deletions src/QueryFilter/Core/QueryFilterWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ class QueryFilterWrapper extends QueryFilter
use HelperEloquentFilter;

/**
* @param Builder $builder
* @param Builder $builder
* @param array|null $request
* @param array|null $ignore_request
* @param array|null $accept_request
* @param array $detect_injected
* @param array $detect_injected
*
* @return void
*/
Expand Down
5 changes: 1 addition & 4 deletions src/QueryFilter/Core/ResolverDetections.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace eloquentFilter\QueryFilter\Core;


use Illuminate\Contracts\Foundation\Application;
use Illuminate\Pipeline\Pipeline;

Expand All @@ -22,7 +20,6 @@ public function __construct($builder, $request, $detect_factory)

public function getResolverOut()
{

$filter_detections = $this->getFilterDetections();

$out = app(Pipeline::class)
Expand All @@ -38,9 +35,9 @@ public function getResolverOut()
* @param $values
* @param $model
*
* @return Application|mixed
* @throws ReflectionException
*
* @return Application|mixed
*/
private function resolve($filterName, $values, $model)
{
Expand Down
3 changes: 1 addition & 2 deletions src/QueryFilter/Detection/DetectorConditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use eloquentFilter\QueryFilter\Exceptions\EloquentFilterException;
use Exception;
use http\Exception\InvalidArgumentException;

/**
* Class DetectorConditions.
Expand Down Expand Up @@ -81,7 +80,7 @@ private function handelListFields(string $field, ?array $list_white_filter_model
$class_name = class_basename($model_class);

throw new EloquentFilterException("You must set $field in whiteListFilter in $class_name.php
or create a override method with name $field or call ignoreRequest function for ignore $field.",1);
or create a override method with name $field or call ignoreRequest function for ignore $field.", 1);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/QueryFilter/Exceptions/EloquentFilterException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace eloquentFilter\QueryFilter\Exceptions;


class EloquentFilterException extends \LogicException
{
}
2 changes: 1 addition & 1 deletion src/QueryFilter/Queries/Special.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function apply($query): Builder
{
foreach ($this->values as $key => $param_value) {
if (!in_array($key, self::$reserve_param['f_params'])) {
throw new EloquentFilterException("$key is not in f_params array.",2);
throw new EloquentFilterException("$key is not in f_params array.", 2);
}
if (is_array($param_value)) {
$this->values['orderBy']['field'] = explode(',', $this->values['orderBy']['field']);
Expand Down

0 comments on commit 1ba8532

Please sign in to comment.