Skip to content

Commit

Permalink
check interface
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Mar 13, 2024
1 parent 6c076ba commit d044188
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 25 deletions.
8 changes: 8 additions & 0 deletions src/Check.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Imanghafoori\LaravelMicroscope;

interface Check
{
//
}
3 changes: 2 additions & 1 deletion src/Checks/CheckIsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
use Imanghafoori\TokenAnalyzer\ParseUseStatement;

class CheckIsQuery
class CheckIsQuery implements Check
{
public static function check($tokens, $absPath)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Checks/CheckRouteCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace Imanghafoori\LaravelMicroscope\Checks;

use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
use Imanghafoori\TokenAnalyzer\FunctionCall;

class CheckRouteCalls
class CheckRouteCalls implements Check
{
public static $checkedRouteCallsNum = 0;

Expand Down
3 changes: 2 additions & 1 deletion src/Checks/CheckStringy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
use Illuminate\Support\Str;
use ImanGhafoori\ComposerJson\NamespaceCalculator;
use Imanghafoori\LaravelMicroscope\Analyzers\ComposerJson;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
use Imanghafoori\TokenAnalyzer\FileManipulator;
use Symfony\Component\Console\Terminal;

class CheckStringy
class CheckStringy implements Check
{
public static function check($tokens, $absFilePath)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Checks/PSR12/CurlyBraces.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace Imanghafoori\LaravelMicroscope\Checks\PSR12;

use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\TokenAnalyzer\Refactor;

class CurlyBraces
class CurlyBraces implements Check
{
public static $command;

Expand Down
3 changes: 2 additions & 1 deletion src/Checks/RoutelessActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

use Illuminate\Routing\Controller;
use ImanGhafoori\ComposerJson\NamespaceCalculator;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
use Imanghafoori\LaravelMicroscope\Psr4Check;
use Imanghafoori\TokenAnalyzer\ClassMethods;
use Imanghafoori\TokenAnalyzer\Str;
use ReflectionClass;
use Throwable;

class RoutelessActions implements Psr4Check
class RoutelessActions implements Check
{
public static function check($tokens, $absFilePath, $params, $classFilePath, $psr4Path, $psr4Namespace)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Features/CheckGenericDocBlocks/GenericDocblocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace Imanghafoori\LaravelMicroscope\Features\CheckGenericDocBlocks;

use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\Checks\RoutelessActions;
use Imanghafoori\LaravelMicroscope\Psr4Check;
use Imanghafoori\TokenAnalyzer\Refactor;
use Imanghafoori\TokenAnalyzer\Str;

class GenericDocblocks implements Psr4Check
class GenericDocblocks implements Check
{
const statements = [
'* Display a listing of the resource.',
Expand Down
3 changes: 2 additions & 1 deletion src/Features/CheckImports/Checks/CheckClassAtMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace Imanghafoori\LaravelMicroscope\Features\CheckImports\Checks;

use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\Features\CheckImports\Handlers\ClassAtMethodHandler;

class CheckClassAtMethod
class CheckClassAtMethod implements Check
{
public static $handler = ClassAtMethodHandler::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace Imanghafoori\LaravelMicroscope\Features\CheckImports\Checks;

use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\Features\CheckImports\Handlers;
use Imanghafoori\TokenAnalyzer\ImportsAnalyzer;

class CheckClassReferencesAreValid
class CheckClassReferencesAreValid implements Check
{
public static $checkWrong = true;

Expand Down
3 changes: 2 additions & 1 deletion src/Features/CheckView/Check/CheckView.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace Imanghafoori\LaravelMicroscope\Features\CheckView\Check;

use Illuminate\Support\Facades\View;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
use Imanghafoori\LaravelMicroscope\Features\CheckView\BladeFile;
use Imanghafoori\TokenAnalyzer\FunctionCall;

class CheckView
class CheckView implements Check
{
public static $checkedCallsCount = 0;

Expand Down
3 changes: 2 additions & 1 deletion src/Features/CheckView/Check/CheckViewFilesExistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
namespace Imanghafoori\LaravelMicroscope\Features\CheckView\Check;

use Illuminate\Support\Facades\View;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\Features\CheckView\BladeFile;

class CheckViewFilesExistence
class CheckViewFilesExistence implements Check
{
public static function check($tokens, $absPath)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Features/ExtractsBladePartials/ExtractBladePartial.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
use Exception;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Str;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\TokenAnalyzer\FunctionCall;
use InvalidArgumentException;

class ExtractBladePartial
class ExtractBladePartial implements Check
{
public static function check($tokens, $absPath)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Features/FacadeAlias/FacadeAliasesCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Imanghafoori\LaravelMicroscope\Features\FacadeAlias;

use Illuminate\Foundation\AliasLoader;
use Imanghafoori\LaravelMicroscope\Check;

class FacadeAliasesCheck
class FacadeAliasesCheck implements Check
{
/**
* @var class-string
Expand Down
3 changes: 2 additions & 1 deletion src/Iterators/BladeFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Imanghafoori\LaravelMicroscope\Iterators;

use Illuminate\Support\Facades\View;
use Imanghafoori\LaravelMicroscope\Check;

class BladeFiles
class BladeFiles implements Check
{
/**
* @param $checkers
Expand Down
8 changes: 0 additions & 8 deletions src/Psr4Check.php

This file was deleted.

3 changes: 2 additions & 1 deletion src/SearchReplace/FullNamespaceIs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Imanghafoori\LaravelMicroscope\SearchReplace;

use Illuminate\Support\Str;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\TokenAnalyzer\GetClassProperties;
use Imanghafoori\TokenAnalyzer\ParseUseStatement;

class FullNamespaceIs
class FullNamespaceIs implements Check
{
public static function check($placeholderVal, $parameter, $tokens)
{
Expand Down
3 changes: 2 additions & 1 deletion src/SearchReplace/IsSubClassOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace Imanghafoori\LaravelMicroscope\SearchReplace;

use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\TokenAnalyzer\GetClassProperties;
use Imanghafoori\TokenAnalyzer\ParseUseStatement;

class IsSubClassOf
class IsSubClassOf implements Check
{
public static function check($placeholderVal, $parameter, $tokens)
{
Expand Down
3 changes: 2 additions & 1 deletion src/SearchReplace/NamespaceIs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Imanghafoori\LaravelMicroscope\SearchReplace;

use Illuminate\Support\Str;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\TokenAnalyzer\GetClassProperties;
use Imanghafoori\TokenAnalyzer\ParseUseStatement;

class NamespaceIs
class NamespaceIs implements Check
{
public static function check($placeholderVal, $parameter, $tokens)
{
Expand Down
3 changes: 2 additions & 1 deletion src/SearchReplace/PatternRefactorings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use Illuminate\Support\Str;
use Imanghafoori\Filesystem\Filesystem;
use Imanghafoori\LaravelMicroscope\Check;
use Imanghafoori\LaravelMicroscope\ErrorReporters\ErrorPrinter;
use Imanghafoori\SearchReplace\Finder;
use Imanghafoori\SearchReplace\Replacer;
use Imanghafoori\SearchReplace\Stringify;
use Imanghafoori\TokenAnalyzer\Refactor;

class PatternRefactorings
class PatternRefactorings implements Check
{
public static $patternFound = false;

Expand Down

0 comments on commit d044188

Please sign in to comment.