class

Analyzer::Php::Symfony

Inherits Analyzer::Php::SymfonyRouteAttributes < Analyzer::Php::PhpEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Constants

DOCBLOCK_FOLLOWER_RE = /\G\s*(?:#\[|(?:(?:public|protected|private|static|final|abstract|readonly)\s+)*(?:function|class)\b)/

A docblock @Route that documents nothing: what follows the docblock is not a declaration (its method was commented out, which without_comments blanked) — Symfony registers no route for it.

FORM_ADD_RE = /->add\s*\(\s*['"]([^'"]+)['"](#{CALL_ARGS_TAIL})\)/
FORM_CALL_RE = /(?:\$this->createForm|->create)\s*\(\s*(?:(\\?[\w\\]+)::class|\$(\w+))/

A form being made: $this->createForm(X::class / a factory's ->create(X::class, or ->createNamed('name', X::class. The type may be a variable (inside a helper that takes it as an argument).

FORM_NAMED_RE = /->createNamed\s*\(\s*(?:['"]([^'"]*)['"]|\$\w+)\s*,\s*(?:(\\?[\w\\]+)::class|\$(\w+))/
FORWARD_RE = /\$this->forward\s*\(\s*['"]\\?([\w\\]+)::(\w+)['"]/

$this->forward('Fqcn::method', ...): a sub-request on the same input.

FOS_PARAM_BAGS = {"QueryParam" => "query", "RequestParam" => "form", "FileParam" => "file"}
FOS_PARAM_RE = /(?:#\[|@)(?:[\w\\]*\\)?(QueryParam|RequestParam|FileParam)\s*\(/

FOSRestBundle's #[Rest\QueryParam(name: 'page')] / @Rest\RequestParam(name="title") / FileParam, which its ParamFetcher reads from the query, the decoded body or the files.

PUBLIC_ATTRIBUTES = ["PUBLIC_ACCESS", "IS_AUTHENTICATED_ANONYMOUSLY"] of ::String

Attributes every caller, anonymous included, is granted.

REQUEST_BAGS = {"query" => "query", "request" => "form", "headers" => "header", "cookies" => "cookie", "files" => "file"}
REQUEST_READ_RE = /\$request->(query|request|headers|cookies|files)->(?:get|all|has|getInt|getBoolean|getAlpha|getAlnum|getDigits|getString|getEnum|filter)\s*\(\s*['"]([^'"]+)['"]|\$request->(query|request)->all\(\s*\)\s*\[\s*['"]([^'"]+)['"]|\$request->get\s*\(\s*['"]([^'"]+)['"]/
SECURITY_ATTR_RE = /(?:#\[|@|,\s*)(?:(IsGranted)\s*\(\s*(?:attribute\s*:\s*)?(?:(['"])(.*?)\2|\\?[\w\\]+::(\w+))?|(Security)\s*\(\s*(?:expression\s*:\s*)?['"])/

#[IsGranted('X')] / @IsGranted("X"), with the voted attribute (a literal or a Class::CONST) when there is one, or #[Security("expr")]. Security must open with its expression string: NelmioApiDoc's @Security(name="Bearer") documents a scheme and checks nothing. A later entry of an attribute group (#[Route('/a'), IsGranted('X')]) counts.

SIGNATURE_RE = /(?:public|protected|private)\s+(?:static\s+)?function\s+(\w+)\s*\(/
UNKNOWN_FORM_NAME = "?"

Stands for a form name that cannot be read statically (createNamed($n, …), a computed getBlockPrefix); ? is not valid in a form name.

Class methods

tech_name
Source

Instance methods

analyze
Source
analyze_file(path : String) : Array(Endpoint)
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source