558 lines
11 KiB
YAML
558 lines
11 KiB
YAML
|
name: ResourceRegistrar
|
||
|
class_comment: null
|
||
|
dependencies:
|
||
|
- name: Str
|
||
|
type: class
|
||
|
source: Illuminate\Support\Str
|
||
|
properties:
|
||
|
- name: router
|
||
|
visibility: protected
|
||
|
comment: '# * The router instance.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var \Illuminate\Routing\Router'
|
||
|
- name: resourceDefaults
|
||
|
visibility: protected
|
||
|
comment: '# * The default actions for a resourceful controller.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string[]'
|
||
|
- name: singletonResourceDefaults
|
||
|
visibility: protected
|
||
|
comment: '# * The default actions for a singleton resource controller.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var string[]'
|
||
|
- name: parameters
|
||
|
visibility: protected
|
||
|
comment: '# * The parameters set for this resource instance.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var array|string'
|
||
|
- name: parameterMap
|
||
|
visibility: protected
|
||
|
comment: '# * The global parameter mapping.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var array'
|
||
|
- name: singularParameters
|
||
|
visibility: protected
|
||
|
comment: '# * Singular global parameters.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var bool'
|
||
|
- name: verbs
|
||
|
visibility: protected
|
||
|
comment: '# * The verbs used in the resource URIs.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @var array'
|
||
|
methods:
|
||
|
- name: __construct
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: router
|
||
|
comment: "# * The router instance.\n# *\n# * @var \\Illuminate\\Routing\\Router\n\
|
||
|
# */\n# protected $router;\n# \n# /**\n# * The default actions for a resourceful\
|
||
|
\ controller.\n# *\n# * @var string[]\n# */\n# protected $resourceDefaults = ['index',\
|
||
|
\ 'create', 'store', 'show', 'edit', 'update', 'destroy'];\n# \n# /**\n# * The\
|
||
|
\ default actions for a singleton resource controller.\n# *\n# * @var string[]\n\
|
||
|
# */\n# protected $singletonResourceDefaults = ['show', 'edit', 'update'];\n#\
|
||
|
\ \n# /**\n# * The parameters set for this resource instance.\n# *\n# * @var array|string\n\
|
||
|
# */\n# protected $parameters;\n# \n# /**\n# * The global parameter mapping.\n\
|
||
|
# *\n# * @var array\n# */\n# protected static $parameterMap = [];\n# \n# /**\n\
|
||
|
# * Singular global parameters.\n# *\n# * @var bool\n# */\n# protected static\
|
||
|
\ $singularParameters = true;\n# \n# /**\n# * The verbs used in the resource URIs.\n\
|
||
|
# *\n# * @var array\n# */\n# protected static $verbs = [\n# 'create' => 'create',\n\
|
||
|
# 'edit' => 'edit',\n# ];\n# \n# /**\n# * Create a new resource registrar instance.\n\
|
||
|
# *\n# * @param \\Illuminate\\Routing\\Router $router\n# * @return void"
|
||
|
- name: register
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
default: '[]'
|
||
|
comment: '# * Route a resource to a controller.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\RouteCollection'
|
||
|
- name: singleton
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
default: '[]'
|
||
|
comment: '# * Route a singleton resource to a controller.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\RouteCollection'
|
||
|
- name: prefixedResource
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Build a set of prefixed resource routes.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Router'
|
||
|
- name: prefixedSingleton
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Build a set of prefixed singleton routes.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Router'
|
||
|
- name: getResourcePrefix
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
comment: '# * Extract the resource and prefix from a resource name.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @return array'
|
||
|
- name: getResourceMethods
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: defaults
|
||
|
- name: options
|
||
|
comment: '# * Get the applicable resource methods.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $defaults
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return array'
|
||
|
- name: addResourceIndex
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the index method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addResourceCreate
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the create method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addResourceStore
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the store method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addResourceShow
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the show method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addResourceEdit
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the edit method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addResourceUpdate
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the update method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addResourceDestroy
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: base
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the destroy method for a resourceful route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $base
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addSingletonCreate
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the create method for a singleton route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addSingletonStore
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the store method for a singleton route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addSingletonShow
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the show method for a singleton route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addSingletonEdit
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the edit method for a singleton route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addSingletonUpdate
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the update method for a singleton route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: addSingletonDestroy
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: controller
|
||
|
- name: options
|
||
|
comment: '# * Add the destroy method for a singleton route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return \Illuminate\Routing\Route'
|
||
|
- name: getShallowName
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: name
|
||
|
- name: options
|
||
|
comment: '# * Get the name for a given resource with shallowness applied when applicable.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $name
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return string'
|
||
|
- name: setResourceBindingFields
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: route
|
||
|
- name: bindingFields
|
||
|
comment: '# * Set the route''s binding fields if the resource is scoped.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param \Illuminate\Routing\Route $route
|
||
|
|
||
|
# * @param array $bindingFields
|
||
|
|
||
|
# * @return void'
|
||
|
- name: getResourceUri
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: resource
|
||
|
comment: '# * Get the base resource URI for a given resource.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $resource
|
||
|
|
||
|
# * @return string'
|
||
|
- name: getNestedResourceUri
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: segments
|
||
|
comment: '# * Get the URI for a nested resource segment array.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $segments
|
||
|
|
||
|
# * @return string'
|
||
|
- name: getResourceWildcard
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: value
|
||
|
comment: '# * Format a resource parameter for usage.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $value
|
||
|
|
||
|
# * @return string'
|
||
|
- name: getResourceAction
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: resource
|
||
|
- name: controller
|
||
|
- name: method
|
||
|
- name: options
|
||
|
comment: '# * Get the action array for a resource route.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $resource
|
||
|
|
||
|
# * @param string $controller
|
||
|
|
||
|
# * @param string $method
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return array'
|
||
|
- name: getResourceRouteName
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: resource
|
||
|
- name: method
|
||
|
- name: options
|
||
|
comment: '# * Get the name for a given resource.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param string $resource
|
||
|
|
||
|
# * @param string $method
|
||
|
|
||
|
# * @param array $options
|
||
|
|
||
|
# * @return string'
|
||
|
- name: singularParameters
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: singular
|
||
|
default: 'true'
|
||
|
comment: '# * Set or unset the unmapped global parameters to singular.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param bool $singular
|
||
|
|
||
|
# * @return void'
|
||
|
- name: getParameters
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: '# * Get the global parameter map.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @return array'
|
||
|
- name: setParameters
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: parameters
|
||
|
default: '[]'
|
||
|
comment: '# * Set the global parameter mapping.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $parameters
|
||
|
|
||
|
# * @return void'
|
||
|
- name: verbs
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: verbs
|
||
|
default: '[]'
|
||
|
comment: '# * Get or set the action verbs used in the resource URIs.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $verbs
|
||
|
|
||
|
# * @return array'
|
||
|
traits:
|
||
|
- Illuminate\Support\Str
|
||
|
interfaces: []
|