diff --git a/.gitignore b/.gitignore index 97d3453..05bb1c4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ installed.lock database.sqlite .htaccess .editorconfig -.idea/* \ No newline at end of file +.idea +.DS_Store diff --git a/application/app/Exceptions/Handler.php b/application/app/Exceptions/Handler.php index c7a75d3..fa80144 100644 --- a/application/app/Exceptions/Handler.php +++ b/application/app/Exceptions/Handler.php @@ -2,6 +2,10 @@ use Exception; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Illuminate\Validation\ValidationException; +use Illuminate\Auth\Access\AuthorizationException; +use Illuminate\Database\Eloquent\ModelNotFoundException; +use Symfony\Component\HttpKernel\Exception\HttpException; class Handler extends ExceptionHandler { @@ -11,7 +15,10 @@ class Handler extends ExceptionHandler { * @var array */ protected $dontReport = [ - 'Symfony\Component\HttpKernel\Exception\HttpException' + AuthorizationException::class, + HttpException::class, + ModelNotFoundException::class, + ValidationException::class, ]; /** diff --git a/application/app/Http/Controllers/AdminController.php b/application/app/Http/Controllers/AdminController.php index 26f70c7..a75863e 100644 --- a/application/app/Http/Controllers/AdminController.php +++ b/application/app/Http/Controllers/AdminController.php @@ -16,7 +16,7 @@ public function index() $data = \Cache::remember('dashboardData', 5, function() { $servers = \App\Server::get(); - $newAccounts = \App\User::needActivation()->count(); + $newAccounts = \App\User::whereRaw('1=1')->needActivation()->count(); $activePlayers = []; $outdatedServers = []; @@ -32,8 +32,8 @@ public function index() foreach(\App\Server::get() as $server) { - $activeBans += \App\PlayerBan::on($server->id)->active()->count(); - $activeMutes += \App\PlayerMute::on($server->id)->active()->count(); + $activeBans += \App\PlayerBan::on($server->id)->whereRaw('1=1')->active()->count(); + $activeMutes += \App\PlayerMute::on($server->id)->whereRaw('1=1')->active()->count(); array_push($activePlayers, \App\Player::on($server->id) ->where('lastSeen', '>=', strtotime("-30 days")) @@ -52,9 +52,9 @@ public function index() $numKicks += \App\PlayerKick::on($server->id)->count(); $numNotes += \App\PlayerNote::on($server->id)->count(); - if(\App\PlayerBan::on($server->id)->outdated()->count() > 0) + if(\App\PlayerBan::on($server->id)->whereRaw('1=1')->outdated()->count() > 0) array_push($outdatedServers, $server->name); - elseif(\App\PlayerMute::on($server->id)->outdated()->count() > 0) + elseif(\App\PlayerMute::on($server->id)->whereRaw('1=1')->outdated()->count() > 0) array_push($outdatedServers, $server->name); } @@ -77,7 +77,7 @@ public function activeBans() $data = \Cache::remember('activeBansData', 1, function() { $activeItems = collect(); foreach(\App\Server::get() as $server) { - $activeItems = $activeItems->merge(\App\PlayerBan::on($server->id)->with('actor','player')->active()->get()); + $activeItems = $activeItems->merge(\App\PlayerBan::on($server->id)->with('actor','player')->whereRaw('1=1')->active()->get()); } $title = trans('app.activeBans'); return compact('activeItems', 'title'); @@ -91,7 +91,7 @@ public function activeMutes() $data = \Cache::remember('activeMutesData', 1, function() { $activeItems = collect(); foreach(\App\Server::get() as $server) { - $activeItems = $activeItems->merge(\App\PlayerMute::on($server->id)->with('actor','player')->active()->get()); + $activeItems = $activeItems->merge(\App\PlayerMute::on($server->id)->with('actor','player')->whereRaw('1=1')->active()->get()); } $title = trans('app.activeMutes'); return compact('activeItems', 'title'); @@ -105,7 +105,7 @@ public function activeWarnings() $data = \Cache::remember('activeWarningsData', 1, function() { $activeItems = collect(); foreach(\App\Server::get() as $server) { - $activeItems = $activeItems->merge(\App\PlayerWarning::on($server->id)->with('actor','player')->active()->get()); + $activeItems = $activeItems->merge(\App\PlayerWarning::on($server->id)->with('actor','player')->whereRaw('1=1')->active()->get()); } $title = trans('app.activeWarnings'); return compact('activeItems', 'title'); diff --git a/application/app/Http/Controllers/Controller.php b/application/app/Http/Controllers/Controller.php index 27b3f45..4e6c868 100644 --- a/application/app/Http/Controllers/Controller.php +++ b/application/app/Http/Controllers/Controller.php @@ -6,6 +6,6 @@ abstract class Controller extends BaseController { - use DispatchesCommands, ValidatesRequests; + use ValidatesRequests; } diff --git a/application/app/Http/Controllers/InstallController.php b/application/app/Http/Controllers/InstallController.php index 51bf0f4..aa8287e 100644 --- a/application/app/Http/Controllers/InstallController.php +++ b/application/app/Http/Controllers/InstallController.php @@ -1,5 +1,7 @@ 'required|url', - 'locale' => 'required', - 'timezone' => 'required', - 'key' => 'required|min:32|max:32', + public function install(Request $request) { - 'name' => 'required|min:3|max:255', - 'email' => 'required|email|max:255', //unique:users removed, as user table does not yet exist - 'password' => 'required|confirmed|min:6', - ]; + $this->validate($request, [ + 'host' => 'required|custom_url', + 'locale' => 'required', + 'timezone' => 'required', + 'key' => 'required|min:32|max:32', - $validator = \Validator::make(\Input::all(), $rules); - - if($validator->fails()) { - return redirect('/install/config') - ->withErrors($validator) - ->withInput(\Input::except('password')); - } + 'name' => 'required|min:3|max:255', + 'email' => 'required|email|max:255', //unique:users removed, as user table does not yet exist + 'password' => 'required|confirmed|min:6', + ]); echo view('install.run'); try { define('STDIN', fopen("php://stdin","r")); - //\Artisan::call('migrate:install'); - \Artisan::call('migrate', [ + \Artisan::call('migrate:refresh', [ '--path' => 'database/migrations', '--env' => 'install', - '--quiet' => true, + '--quiet' => true, '--force' => true ]); } catch(\Exception $e) { diff --git a/application/app/Http/Controllers/PlayerBanController.php b/application/app/Http/Controllers/PlayerBanController.php index 6148a66..115952e 100644 --- a/application/app/Http/Controllers/PlayerBanController.php +++ b/application/app/Http/Controllers/PlayerBanController.php @@ -33,9 +33,7 @@ public function index() */ public function create($player = null) { - if($player == null) - unset($player); - else + if(!$player == null) $player = $player[0]; foreach(\App\Server::get() as $server) { @@ -63,7 +61,7 @@ public function store() 'player' => 'required', 'expires' => 'future' ); - + $validator = \Validator::make(\Input::all(), $rules); if ($validator->fails()) { @@ -141,7 +139,7 @@ public function update($server, $id) 'player' => 'required', 'expires' => 'future' ); - + $validator = \Validator::make(\Input::all(), $rules); if ($validator->fails()) { diff --git a/application/app/Http/Controllers/PlayerMuteController.php b/application/app/Http/Controllers/PlayerMuteController.php index bc33a51..73a2186 100644 --- a/application/app/Http/Controllers/PlayerMuteController.php +++ b/application/app/Http/Controllers/PlayerMuteController.php @@ -33,9 +33,7 @@ public function index() */ public function create($player = null) { - if($player == null) - unset($player); - else + if(!$player == null) $player = $player[0]; foreach(\App\Server::get() as $server) { @@ -63,7 +61,7 @@ public function store() 'player' => 'required', 'expires' => 'future' ); - + $validator = \Validator::make(\Input::all(), $rules); if ($validator->fails()) { @@ -141,7 +139,7 @@ public function update($server, $id) 'player' => 'required', 'expires' => 'future' ); - + $validator = \Validator::make(\Input::all(), $rules); if ($validator->fails()) { diff --git a/application/app/Http/Controllers/PlayerNoteController.php b/application/app/Http/Controllers/PlayerNoteController.php index 2d9f3cc..c1053f9 100644 --- a/application/app/Http/Controllers/PlayerNoteController.php +++ b/application/app/Http/Controllers/PlayerNoteController.php @@ -42,9 +42,7 @@ public function index() */ public function create($player = null) { - if($player == null) - unset($player); - else + if(!$player == null) $player = $player[0]; foreach(\App\Server::get() as $server) { diff --git a/application/app/Http/Controllers/PlayerWarningController.php b/application/app/Http/Controllers/PlayerWarningController.php index 2a7a51e..9341be0 100644 --- a/application/app/Http/Controllers/PlayerWarningController.php +++ b/application/app/Http/Controllers/PlayerWarningController.php @@ -33,9 +33,7 @@ public function index() */ public function create($player = null) { - if($player == null) - unset($player); - else + if(!$player == null) $player = $player[0]; foreach(\App\Server::get() as $server) { @@ -57,7 +55,7 @@ public function store() 'reason' => 'required', 'player' => 'required', ); - + $validator = \Validator::make(\Input::all(), $rules); if ($validator->fails()) { @@ -120,7 +118,7 @@ public function update($server, $id) 'reason' => 'required', 'player' => 'required', ); - + $validator = \Validator::make(\Input::all(), $rules); if ($validator->fails()) { diff --git a/application/app/Http/Controllers/StatsController.php b/application/app/Http/Controllers/StatsController.php index 026a7a7..b6c3090 100644 --- a/application/app/Http/Controllers/StatsController.php +++ b/application/app/Http/Controllers/StatsController.php @@ -23,8 +23,8 @@ public function index() foreach($servers as $server) { $players[$server->id] = \App\Player::on($server->id)->count(); - $activeBans[$server->id] = \App\PlayerBan::on($server->id)->active()->count(); - $activeMutes[$server->id] = \App\PlayerMute::on($server->id)->active()->count(); + $activeBans[$server->id] = \App\PlayerBan::on($server->id)->whereRaw('1=1')->active()->count(); + $activeMutes[$server->id] = \App\PlayerMute::on($server->id)->whereRaw('1=1')->active()->count(); $numBans += \App\PlayerBan::on($server->id)->count(); $numBans += \App\PlayerBanRecord::on($server->id)->count(); diff --git a/application/app/Http/Middleware/VerifyServers.php b/application/app/Http/Middleware/VerifyServers.php index 47d2eff..d5f5623 100644 --- a/application/app/Http/Middleware/VerifyServers.php +++ b/application/app/Http/Middleware/VerifyServers.php @@ -33,7 +33,7 @@ public function __construct(Guard $auth) */ public function handle($request, Closure $next) { - if (\App\Server::get()->count() <= 0) + if (\App\Server::count() <= 0) { return redirect('/admin/servers/create')->with('message', trans('app.addServerFirst')); } diff --git a/application/app/PastRecordBaseModel.php b/application/app/PastRecordBaseModel.php index 90362dc..e01991e 100644 --- a/application/app/PastRecordBaseModel.php +++ b/application/app/PastRecordBaseModel.php @@ -12,8 +12,10 @@ class PastRecordBaseModel extends Model { public $timestamps = false; + public $incrementing = false; + public function getPastActorUuidAttribute() - { + { $this->attributes['past_actor_uuid'] = id_to_uuid($this->attributes['pastActor_id']); return $this->attributes['past_actor_uuid']; } @@ -25,7 +27,7 @@ public function setPastActorUuidAttribute($value) } public function getPlayerUuidAttribute() - { + { $this->attributes['player_uuid'] = id_to_uuid($this->attributes['player_id']); return $this->attributes['player_uuid']; } @@ -37,7 +39,7 @@ public function setPlayerUuidAttribute($value) } public function getActorUuidAttribute() - { + { $this->attributes['actor_uuid'] = id_to_uuid($this->attributes['actor_id']); return $this->attributes['actor_uuid']; } @@ -95,10 +97,10 @@ public function setExpiredAttribute($value) } public function getDurationAttribute() - { + { if($this->expired->timestamp == 0) return null; - + return $this->expired->diffForHumans($this->pastCreated, true); } diff --git a/application/app/Player.php b/application/app/Player.php index 6b03c5e..2fd155a 100644 --- a/application/app/Player.php +++ b/application/app/Player.php @@ -14,6 +14,8 @@ class Player extends Model { public $timestamps = false; + public $incrementing = false; + public function bans() { return $this->hasManyRelation('App\PlayerBan'); @@ -58,7 +60,7 @@ public function getIpAttribute() { } public function getUuidAttribute() - { + { $this->attributes['uuid'] = id_to_uuid($this->attributes['id']); // Fixes #109 when uuid not set return $this->attributes['uuid'] ?: 'unset'; diff --git a/application/app/PlayerWarning.php b/application/app/PlayerWarning.php index 59648be..7c70b39 100644 --- a/application/app/PlayerWarning.php +++ b/application/app/PlayerWarning.php @@ -7,10 +7,13 @@ class PlayerWarning extends RecordBaseModel { protected $table = 'player_warnings'; - public function scopeActive($query) - { - return $query->where('expires', '>=', Carbon::now()->timestamp)->orWhere('expires', '=', 0); - } + public function scopeActive($query) + { + return $query->where(function ($query) { + $query->where('expires', '>=', Carbon::now()->timestamp) + ->orWhere('expires', '=', 0); + }); + } public function scopeOutdated($query) { diff --git a/application/app/Providers/AppServiceProvider.php b/application/app/Providers/AppServiceProvider.php index 8f2e405..1090816 100644 --- a/application/app/Providers/AppServiceProvider.php +++ b/application/app/Providers/AppServiceProvider.php @@ -1,6 +1,7 @@ http://symfony.com + */ + $pattern = '~^ + (aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap\+tcp|coap\+ws|coaps|coaps\+tcp|coaps\+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris\.beep|iris\.lwz|iris\.xpc|iris\.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap\.beep|soap\.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|things|thismessage|tip|tn3270|tool|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc\.beep|xmlrpc\.beeps|xmpp|xri|ymsgr|z39\.50|z39\.50r|z39\.50s):// # protocol + (((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+)@)? # basic auth + ( + ([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name + | # or + \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address + | # or + \[ + (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) + \] # an IPv6 address + ) + (:[0-9]+)? # a port (optional) + (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%[0-9A-Fa-f]{2})* )* # a path + (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )? # a query (optional) + (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )? # a fragment (optional) + $~ixu'; + + return preg_match($pattern, $value) > 0; + }); } /** diff --git a/application/app/Providers/BusServiceProvider.php b/application/app/Providers/BusServiceProvider.php deleted file mode 100644 index f0d9be6..0000000 --- a/application/app/Providers/BusServiceProvider.php +++ /dev/null @@ -1,34 +0,0 @@ -mapUsing(function($command) - { - return Dispatcher::simpleMapping( - $command, 'App\Commands', 'App\Handlers\Commands' - ); - }); - } - - /** - * Register any application services. - * - * @return void - */ - public function register() - { - // - } - -} diff --git a/application/app/RecordBaseModel.php b/application/app/RecordBaseModel.php index 1b10db2..ffebf71 100644 --- a/application/app/RecordBaseModel.php +++ b/application/app/RecordBaseModel.php @@ -12,8 +12,10 @@ class RecordBaseModel extends Model { public $timestamps = false; + public $incrementing = false; + public function getPlayerUuidAttribute() - { + { $this->attributes['player_uuid'] = id_to_uuid($this->attributes['player_id']); return $this->attributes['player_uuid']; } @@ -25,7 +27,7 @@ public function setPlayerUuidAttribute($value) } public function getActorUuidAttribute() - { + { $this->attributes['actor_uuid'] = id_to_uuid($this->attributes['actor_id']); return $this->attributes['actor_uuid']; } @@ -78,10 +80,10 @@ public function setExpiresAttribute($value) } public function getDurationAttribute() - { + { if($this->expires->timestamp == 0) return null; - + return $this->expires->diffForHumans($this->created, true); } diff --git a/application/composer.json b/application/composer.json index b9b75ef..794094b 100644 --- a/application/composer.json +++ b/application/composer.json @@ -5,8 +5,8 @@ "license": "cc-by-nc-sa 4.0", "type": "project", "require": { - "laravel/framework": "5.1.*", - "laravelcollective/html": "5.1.*" + "laravel/framework": "5.2.*", + "laravelcollective/html": "5.2.*" }, "autoload": { "classmap": [ @@ -34,5 +34,7 @@ "preferred-install": "dist" }, "require-dev": { + "symfony/dom-crawler": "~3.0", + "symfony/css-selector": "~3.0" } } diff --git a/application/composer.lock b/application/composer.lock index 2e686f2..1092d6a 100644 --- a/application/composer.lock +++ b/application/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "caa30f5960724cf52d625ba91d0cc332", + "content-hash": "d2f32bbcd4c2fe96db4239de773cd243", "packages": [ { "name": "classpreloader/classpreloader", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/ClassPreloader/ClassPreloader.git", - "reference": "4729e438e0ada350f91148e7d4bb9809342575ff" + "reference": "297db07cabece3946f4a98d23f11f90aa10e1797" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/4729e438e0ada350f91148e7d4bb9809342575ff", - "reference": "4729e438e0ada350f91148e7d4bb9809342575ff", + "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/297db07cabece3946f4a98d23f11f90aa10e1797", + "reference": "297db07cabece3946f4a98d23f11f90aa10e1797", "shasum": "" }, "require": { @@ -58,63 +58,13 @@ "class", "preload" ], - "time": "2017-12-10T11:40:39+00:00" - }, - { - "name": "danielstjules/stringy", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/danielstjules/Stringy.git", - "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", - "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Stringy\\": "src/" - }, - "files": [ - "src/Create.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + "funding": [ { - "name": "Daniel St. Jules", - "email": "danielst.jules@gmail.com", - "homepage": "http://www.danielstjules.com" + "url": "https://tidelift.com/funding/github/packagist/classpreloader/classpreloader", + "type": "tidelift" } ], - "description": "A string manipulation library with multibyte support", - "homepage": "https://github.com/danielstjules/Stringy", - "keywords": [ - "UTF", - "helpers", - "manipulation", - "methods", - "multibyte", - "string", - "utf-8", - "utility", - "utils" - ], - "time": "2015-07-23T00:54:12+00:00" + "time": "2020-04-12T22:01:25+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -151,33 +101,38 @@ }, { "name": "doctrine/inflector", - "version": "v1.3.0", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a" + "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4650c8b30c753a76bf44fb2ed00117d6f367490c", + "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "doctrine/coding-standard": "^7.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector", + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -185,6 +140,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -193,10 +152,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -206,15 +161,35 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "keywords": [ "inflection", - "pluralize", - "singularize", - "string" + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } ], - "time": "2018-01-09T20:05:19+00:00" + "time": "2020-05-29T07:19:59+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -256,6 +231,7 @@ "email": "jakub.onderka@gmail.com" } ], + "abandoned": "php-parallel-lint/php-console-color", "time": "2018-09-29T17:23:10+00:00" }, { @@ -300,6 +276,7 @@ "homepage": "http://www.acci.cz/" } ], + "abandoned": "php-parallel-lint/php-console-highlighter", "time": "2015-04-20T18:58:01+00:00" }, { @@ -358,20 +335,21 @@ "serialize", "tokenizer" ], + "abandoned": "opis/closure", "time": "2018-03-21T22:21:57+00:00" }, { "name": "kylekatarnls/update-helper", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/kylekatarnls/update-helper.git", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e" + "reference": "429be50660ed8a196e0798e5939760f168ec8ce9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e", + "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/429be50660ed8a196e0798e5939760f168ec8ce9", + "reference": "429be50660ed8a196e0798e5939760f168ec8ce9", "shasum": "" }, "require": { @@ -403,49 +381,61 @@ } ], "description": "Update helper", - "time": "2019-07-29T11:03:54+00:00" + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2020-04-07T20:44:10+00:00" }, { "name": "laravel/framework", - "version": "v5.1.46", + "version": "v5.2.45", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "7f2f892e62163138121e8210b92b21394fda8d1c" + "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/7f2f892e62163138121e8210b92b21394fda8d1c", - "reference": "7f2f892e62163138121e8210b92b21394fda8d1c", + "url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1", + "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1", "shasum": "" }, "require": { - "classpreloader/classpreloader": "~2.0|~3.0", - "danielstjules/stringy": "~1.8", + "classpreloader/classpreloader": "~3.0", "doctrine/inflector": "~1.0", "ext-mbstring": "*", "ext-openssl": "*", - "jeremeamia/superclosure": "~2.0", + "jeremeamia/superclosure": "~2.2", "league/flysystem": "~1.0", "monolog/monolog": "~1.11", "mtdowling/cron-expression": "~1.0", - "nesbot/carbon": "~1.19", + "nesbot/carbon": "~1.20", "paragonie/random_compat": "~1.4", "php": ">=5.5.9", "psy/psysh": "0.7.*", "swiftmailer/swiftmailer": "~5.1", - "symfony/console": "2.7.*", - "symfony/css-selector": "2.7.*|2.8.*", - "symfony/debug": "2.7.*", - "symfony/dom-crawler": "2.7.*", - "symfony/finder": "2.7.*", - "symfony/http-foundation": "2.7.*", - "symfony/http-kernel": "2.7.*", - "symfony/process": "2.7.*", - "symfony/routing": "2.7.*", - "symfony/translation": "2.7.*", - "symfony/var-dumper": "2.7.*", - "vlucas/phpdotenv": "~1.0" + "symfony/console": "2.8.*|3.0.*", + "symfony/debug": "2.8.*|3.0.*", + "symfony/finder": "2.8.*|3.0.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/http-kernel": "2.8.*|3.0.*", + "symfony/polyfill-php56": "~1.0", + "symfony/process": "2.8.*|3.0.*", + "symfony/routing": "2.8.*|3.0.*", + "symfony/translation": "2.8.*|3.0.*", + "symfony/var-dumper": "2.8.*|3.0.*", + "vlucas/phpdotenv": "~2.2" }, "replace": { "illuminate/auth": "self.version", @@ -475,33 +465,36 @@ "illuminate/support": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "tightenco/collect": "self.version" }, "require-dev": { "aws/aws-sdk-php": "~3.0", - "iron-io/iron_mq": "~2.0", "mockery/mockery": "~0.9.4", "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~4.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "~4.1", + "predis/predis": "~1.0", + "symfony/css-selector": "2.8.*|3.0.*", + "symfony/dom-crawler": "2.8.*|3.0.*" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", - "iron-io/iron_mq": "Required to use the iron queue driver (~2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." + "symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "autoload": { @@ -532,30 +525,32 @@ "framework", "laravel" ], - "time": "2017-03-24T16:31:45+00:00" + "time": "2016-08-26T11:44:52+00:00" }, { "name": "laravelcollective/html", - "version": "v5.1.11", + "version": "v5.2.6", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "99342cc22507cf8d7178bb390c215968183993bb" + "reference": "4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/99342cc22507cf8d7178bb390c215968183993bb", - "reference": "99342cc22507cf8d7178bb390c215968183993bb", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e", + "reference": "4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e", "shasum": "" }, "require": { - "illuminate/http": "5.1.*", - "illuminate/routing": "5.1.*", - "illuminate/session": "5.1.*", - "illuminate/support": "5.1.*", + "illuminate/http": "5.2.*", + "illuminate/routing": "5.2.*", + "illuminate/session": "5.2.*", + "illuminate/support": "5.2.*", + "illuminate/view": "5.2.*", "php": ">=5.5.9" }, "require-dev": { + "illuminate/database": "5.2.*", "mockery/mockery": "~0.9", "phpunit/phpunit": "~4.0" }, @@ -582,32 +577,35 @@ "email": "adam@laravelcollective.com" } ], - "time": "2017-09-07T18:12:11+00:00" + "description": "HTML and Form Builders for the Laravel Framework", + "homepage": "http://laravelcollective.com", + "time": "2017-05-21T18:02:21+00:00" }, { "name": "league/flysystem", - "version": "1.0.57", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": ">=5.5.9" + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" }, "conflict": { "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7.10" + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -666,20 +664,77 @@ "sftp", "storage" ], - "time": "2019-10-16T21:01:05+00:00" + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2020-08-23T07:39:11+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.36", + "phpunit/phpunit": "^8.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2020-10-18T11:50:25+00:00" }, { "name": "monolog/monolog", - "version": "1.25.1", + "version": "1.25.5", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" + "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0", + "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0", "shasum": "" }, "require": { @@ -693,11 +748,10 @@ "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "^5.3|^6.0" @@ -744,20 +798,30 @@ "logging", "psr-3" ], - "time": "2019-09-06T13:49:17+00:00" + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2020-07-23T08:35:51+00:00" }, { "name": "mtdowling/cron-expression", - "version": "v1.2.1", + "version": "v1.2.3", "source": { "type": "git", "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad" + "reference": "9be552eebcc1ceec9776378f7dcc085246cacca6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", + "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9be552eebcc1ceec9776378f7dcc085246cacca6", + "reference": "9be552eebcc1ceec9776378f7dcc085246cacca6", "shasum": "" }, "require": { @@ -788,7 +852,8 @@ "cron", "schedule" ], - "time": "2017-01-23T04:29:33+00:00" + "abandoned": "dragonmantank/cron-expression", + "time": "2019-12-28T04:23:06+00:00" }, { "name": "nesbot/carbon", @@ -952,16 +1017,16 @@ }, { "name": "psr/log", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -995,7 +1060,7 @@ "psr", "psr-3" ], - "time": "2019-11-01T11:05:21+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "psy/psysh", @@ -1125,36 +1190,36 @@ }, { "name": "symfony/console", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "574cb4cfaa01ba115fc2fc0c2355b2c5472a4804" + "reference": "926061e74229e935d3c5b4e9ba87237316c6693f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/574cb4cfaa01ba115fc2fc0c2355b2c5472a4804", - "reference": "574cb4cfaa01ba115fc2fc0c2355b2c5472a4804", + "url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f", + "reference": "926061e74229e935d3c5b4e9ba87237316c6693f", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1181,90 +1246,37 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-13T15:44:36+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v2.8.50", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "7b1692e418d7ccac24c373528453bc90e42797de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/7b1692e418d7ccac24c373528453bc90e42797de", - "reference": "7b1692e418d7ccac24c373528453bc90e42797de", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2018-11-11T11:18:13+00:00" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/debug", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "4a7330f29b3d215f8bacf076689f9d1c3d568681" + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/4a7330f29b3d215f8bacf076689f9d1c3d568681", - "reference": "4a7330f29b3d215f8bacf076689f9d1c3d568681", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.2", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2" + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1291,98 +1303,41 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-08-03T11:24:48+00:00" - }, - { - "name": "symfony/dom-crawler", - "version": "v2.7.51", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "d905e1c5885735ee66af60c205429b9941f24752" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d905e1c5885735ee66af60c205429b9941f24752", - "reference": "d905e1c5885735ee66af60c205429b9941f24752", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8" - }, - "require-dev": { - "symfony/css-selector": "~2.3" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2018-05-01T22:30:49+00:00" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.50", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + "reference": "31fde73757b6bad247c54597beef974919ec6860" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/31fde73757b6bad247c54597beef974919ec6860", + "reference": "31fde73757b6bad247c54597beef974919ec6860", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/debug": "~3.4|~4.4", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", "symfony/http-kernel": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" @@ -1407,29 +1362,43 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-11-21T14:20:20+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" }, { "name": "symfony/finder", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "34226a3aa279f1e356ad56181b91acfdc9a2525c" + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/34226a3aa279f1e356ad56181b91acfdc9a2525c", - "reference": "34226a3aa279f1e356ad56181b91acfdc9a2525c", + "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1456,42 +1425,39 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-05-14T06:36:14+00:00" + "time": "2016-06-29T05:40:00+00:00" }, { "name": "symfony/http-foundation", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b67e5cbd2bf837fb3681f2c4965826d6c6758532" + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b67e5cbd2bf837fb3681f2c4965826d6c6758532", - "reference": "b67e5cbd2bf837fb3681f2c4965826d6c6758532", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82", + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.4" + "symfony/expression-language": "~2.8|~3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" }, - "classmap": [ - "Resources/stubs" - ], "exclude-from-classmap": [ "/Tests/" ] @@ -1512,50 +1478,48 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-04-16T09:58:21+00:00" + "time": "2016-07-17T13:54:30+00:00" }, { "name": "symfony/http-kernel", - "version": "v2.7.52", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "435064b3b143f79469206915137c21e88b56bfb9" + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/435064b3b143f79469206915137c21e88b56bfb9", - "reference": "435064b3b143f79469206915137c21e88b56bfb9", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "psr/log": "~1.0", - "symfony/debug": "^2.6.2", - "symfony/event-dispatcher": "^2.6.7", - "symfony/http-foundation": "~2.7.36|^2.8.29", - "symfony/polyfill-ctype": "~1.8" + "symfony/debug": "~2.8|~3.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" }, "conflict": { - "symfony/config": "<2.7", - "twig/twig": "<1.34|<2.4,>=2" + "symfony/config": "<2.8" }, "require-dev": { - "symfony/browser-kit": "~2.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.7", - "symfony/console": "~2.3", - "symfony/css-selector": "^2.0.5", - "symfony/dependency-injection": "~2.2", - "symfony/dom-crawler": "^2.0.5", - "symfony/expression-language": "~2.4", - "symfony/finder": "^2.0.5", - "symfony/process": "^2.0.5", - "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.3", - "symfony/templating": "~2.2", - "symfony/translation": "^2.0.5", - "symfony/var-dumper": "~2.6" + "symfony/browser-kit": "~2.8|~3.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0", + "symfony/console": "~2.8|~3.0", + "symfony/css-selector": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/dom-crawler": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/finder": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0", + "symfony/routing": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0", + "symfony/templating": "~2.8|~3.0", + "symfony/translation": "~2.8|~3.0", + "symfony/var-dumper": "~2.8|~3.0" }, "suggest": { "symfony/browser-kit": "", @@ -1569,7 +1533,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1596,24 +1560,24 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-04-17T16:37:53+00:00" + "time": "2016-07-30T09:10:37+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" @@ -1621,7 +1585,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1654,24 +1622,38 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -1679,7 +1661,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1713,39 +1699,48 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/polyfill-php56", - "version": "v1.12.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "0e3b212e96a51338639d8ce175c046d7729c3403" + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/0e3b212e96a51338639d8ce175c046d7729c3403", - "reference": "0e3b212e96a51338639d8ce175c046d7729c3403", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-util": "~1.0" + "php": ">=7.1" }, - "type": "library", + "type": "metapackage", "extra": { "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php56\\": "" + "dev-main": "1.20-dev" }, - "files": [ - "bootstrap.php" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1769,81 +1764,43 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "symfony/polyfill-util", - "version": "v1.12.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-util.git", - "reference": "4317de1386717b4c22caed7725350a8887ab205c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4317de1386717b4c22caed7725350a8887ab205c", - "reference": "4317de1386717b4c22caed7725350a8887ab205c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Util\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + "funding": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Symfony utilities for portability of PHP codes", - "homepage": "https://symfony.com", - "keywords": [ - "compat", - "compatibility", - "polyfill", - "shim" - ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/process", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "eda637e05670e2afeec3842dcd646dce94262f6b" + "reference": "768debc5996f599c4372b322d9061dba2a4bf505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/eda637e05670e2afeec3842dcd646dce94262f6b", - "reference": "eda637e05670e2afeec3842dcd646dce94262f6b", + "url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505", + "reference": "768debc5996f599c4372b322d9061dba2a4bf505", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1870,40 +1827,41 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-08-03T11:24:48+00:00" + "time": "2016-07-28T11:13:34+00:00" }, { "name": "symfony/routing", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "33bd5882f201f9a3b7dd9640b95710b71304c4fb" + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/33bd5882f201f9a3b7dd9640b95710b71304c4fb", - "reference": "33bd5882f201f9a3b7dd9640b95710b71304c4fb", + "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<2.8" }, "require-dev": { "doctrine/annotations": "~1.0", "doctrine/common": "~2.2", "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/expression-language": "~2.4", - "symfony/http-foundation": "~2.3", - "symfony/yaml": "^2.0.5" + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "suggest": { "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" @@ -1911,7 +1869,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1944,43 +1902,44 @@ "uri", "url" ], - "time": "2018-02-28T09:36:59+00:00" + "time": "2016-06-29T05:40:00+00:00" }, { "name": "symfony/translation", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "1959c78c5a32539ef221b3e18a961a96d949118f" + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/1959c78c5a32539ef221b3e18a961a96d949118f", - "reference": "1959c78c5a32539ef221b3e18a961a96d949118f", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<2.8" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.7.25|^2.8.18", - "symfony/yaml": "~2.2" + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "suggest": { - "psr/log-implementation": "To use logging capability in translator", + "psr/log": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2007,27 +1966,28 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-05-17T10:34:06+00:00" + "time": "2016-07-30T07:22:48+00:00" }, { "name": "symfony/var-dumper", - "version": "v2.7.51", + "version": "v3.0.9", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6f9271e94369db05807b261fcfefe4cd1aafd390" + "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6f9271e94369db05807b261fcfefe4cd1aafd390", - "reference": "6f9271e94369db05807b261fcfefe4cd1aafd390", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377", + "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "require-dev": { + "twig/twig": "~1.20|~2.0" }, "suggest": { "ext-symfony_debug": "" @@ -2035,7 +1995,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2069,61 +2029,217 @@ "debug", "dump" ], - "time": "2018-04-22T05:56:10+00:00" + "time": "2016-07-26T08:03:56+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v1.1.1", + "version": "v2.6.6", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa" + "reference": "e1d57f62db3db00d9139078cbedf262280701479" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa", - "reference": "0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/e1d57f62db3db00d9139078cbedf262280701479", + "reference": "e1d57f62db3db00d9139078cbedf262280701479", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.3.9 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.17" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-filter": "*", + "ext-pcre": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7.27" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator.", + "ext-pcre": "Required to use most of the library." }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, "autoload": { - "psr-0": { - "Dotenv": "src/" + "psr-4": { + "Dotenv\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "BSD-3-Clause" ], "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "homepage": "https://gjcampbell.co.uk/" + }, { "name": "Vance Lucas", "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" + "homepage": "https://vancelucas.com/" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "homepage": "http://github.com/vlucas/phpdotenv", "keywords": [ "dotenv", "env", "environment" ], - "time": "2015-05-30T15:59:26+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2020-07-14T17:54:18+00:00" + } + ], + "packages-dev": [ + { + "name": "symfony/css-selector", + "version": "v3.4.46", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v3.4.46", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "ef97bcfbae5b384b4ca6c8d57b617722f15241a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/ef97bcfbae5b384b4ca6c8d57b617722f15241a6", + "reference": "ef97bcfbae5b384b4ca6c8d57b617722f15241a6", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "symfony/css-selector": "~2.8|~3.0|~4.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" } ], - "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/application/config/app.php b/application/config/app.php index 267d1f3..4dbb3ae 100644 --- a/application/config/app.php +++ b/application/config/app.php @@ -2,6 +2,8 @@ return [ + 'env' => env('APP_ENV', 'production'), + /* |-------------------------------------------------------------------------- | Application Debug Mode @@ -113,12 +115,9 @@ /* * Laravel Framework Service Providers... */ - 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', - 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', - 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', @@ -142,7 +141,6 @@ * Application Service Providers... */ 'App\Providers\AppServiceProvider', - 'App\Providers\BusServiceProvider', 'App\Providers\ConfigServiceProvider', 'App\Providers\EventServiceProvider', 'App\Providers\RouteServiceProvider', diff --git a/application/config/auth.php b/application/config/auth.php index 5b436aa..afe21c3 100644 --- a/application/config/auth.php +++ b/application/config/auth.php @@ -2,66 +2,106 @@ return [ - /* - |-------------------------------------------------------------------------- - | Default Authentication Driver - |-------------------------------------------------------------------------- - | - | This option controls the authentication driver that will be utilized. - | This driver manages the retrieval and authentication of the users - | attempting to get access to protected areas of your application. - | - | Supported: "database", "eloquent" - | - */ + /* + |-------------------------------------------------------------------------- + | Authentication Defaults + |-------------------------------------------------------------------------- + | + | This option controls the default authentication "guard" and password + | reset options for your application. You may change these defaults + | as required, but they're a perfect start for most applications. + | + */ - 'driver' => 'eloquent', + 'defaults' => [ + 'guard' => 'web', + 'passwords' => 'users', + ], - /* - |-------------------------------------------------------------------------- - | Authentication Model - |-------------------------------------------------------------------------- - | - | When using the "Eloquent" authentication driver, we need to know which - | Eloquent model should be used to retrieve your users. Of course, it - | is often just the "User" model but you may use whatever you like. - | - */ + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ - 'model' => 'App\User', + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], - /* - |-------------------------------------------------------------------------- - | Authentication Table - |-------------------------------------------------------------------------- - | - | When using the "Database" authentication driver, we need to know which - | table should be used to retrieve your users. We have chosen a basic - | default value but you may easily change it to any table you like. - | - */ + 'api' => [ + 'driver' => 'token', + 'provider' => 'users', + ], + ], - 'table' => 'users', + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ - /* - |-------------------------------------------------------------------------- - | Password Reset Settings - |-------------------------------------------------------------------------- - | - | Here you may set the options for resetting passwords including the view - | that is your password reset e-mail. You can also set the name of the - | table that maintains all of the reset tokens for your application. - | - | The expire time is the number of minutes that the reset token should be - | considered valid. This security feature keeps tokens short-lived so - | they have less time to be guessed. You may change this as needed. - | - */ + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\User::class, + ], - 'password' => [ - 'email' => 'emails.password', - 'table' => 'password_resets', - 'expire' => 60, - ], + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], -]; + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | Here you may set the options for resetting passwords including the view + | that is your password reset e-mail. You may also set the name of the + | table that maintains all of the reset tokens for your application. + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | seperate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'email' => 'emails.password', + 'table' => 'password_resets', + 'expire' => 60, + ], + ], + +]; \ No newline at end of file diff --git a/application/config/compile.php b/application/config/compile.php index 3a002fc..0609306 100644 --- a/application/config/compile.php +++ b/application/config/compile.php @@ -16,8 +16,6 @@ 'files' => [ realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'), - realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'), - realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'), realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'), realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'), diff --git a/application/database/seeds/DatabaseSeeder.php b/application/database/seeds/DatabaseSeeder.php index b3c69b5..de57b7c 100644 --- a/application/database/seeds/DatabaseSeeder.php +++ b/application/database/seeds/DatabaseSeeder.php @@ -12,8 +12,6 @@ class DatabaseSeeder extends Seeder { */ public function run() { - Model::unguard(); - // $this->call('UserTableSeeder'); } diff --git a/application/resources/lang/de/validation.php b/application/resources/lang/de/validation.php index 5bfed4a..ef3cc59 100644 --- a/application/resources/lang/de/validation.php +++ b/application/resources/lang/de/validation.php @@ -72,6 +72,7 @@ ], "unique" => ":attribute wird bereits verwendet.", "url" => ":attribute ist ungültig.", + "custom_url" => ":attribute ist ungültig.", "timezone" => ":attribute muss eine gültige Zeitzone sein.", "role" => ":attribute muss eine gültige Benutzer-Rolle sein.", "future" => ":attribute muss eine gültige Zeit bzw. Datum sein.", diff --git a/application/resources/lang/en/validation.php b/application/resources/lang/en/validation.php index 18ea218..97b30b3 100644 --- a/application/resources/lang/en/validation.php +++ b/application/resources/lang/en/validation.php @@ -72,6 +72,7 @@ ], "unique" => "The :attribute has already been taken.", "url" => "The :attribute format is invalid.", + "custom_url" => "The :attribute format is invalid.", "timezone" => "The :attribute must be a valid zone.", "role" => "The :attribute has to be a valid user role.", "future" => "The :attribute has to be a valid expire datetime.", diff --git a/application/vendor/autoload.php b/application/vendor/autoload.php index 59fc4d5..a6dcd64 100644 --- a/application/vendor/autoload.php +++ b/application/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit43265f891b9f29a025a40de9ffd797c4::getLoader(); +return ComposerAutoloaderInitf78e08ce03e899835ef37b4c3f44d248::getLoader(); diff --git a/application/vendor/bin/php-parse b/application/vendor/bin/php-parse deleted file mode 100644 index 76d2d68..0000000 --- a/application/vendor/bin/php-parse +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd '../nikic/php-parser/bin' && pwd) - -if [ -d /proc/cygdrive ]; then - case $(which php) in - $(readlink -n /proc/cygdrive)/*) - # We are in Cygwin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); - ;; - esac -fi - -"${dir}/php-parse" "$@" diff --git a/application/vendor/bin/php-parse b/application/vendor/bin/php-parse new file mode 120000 index 0000000..062d66a --- /dev/null +++ b/application/vendor/bin/php-parse @@ -0,0 +1 @@ +../nikic/php-parser/bin/php-parse \ No newline at end of file diff --git a/application/vendor/bin/psysh b/application/vendor/bin/psysh deleted file mode 100644 index e43e1bb..0000000 --- a/application/vendor/bin/psysh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd '../psy/psysh/bin' && pwd) - -if [ -d /proc/cygdrive ]; then - case $(which php) in - $(readlink -n /proc/cygdrive)/*) - # We are in Cygwin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); - ;; - esac -fi - -"${dir}/psysh" "$@" diff --git a/application/vendor/bin/psysh b/application/vendor/bin/psysh new file mode 120000 index 0000000..3c06b1a --- /dev/null +++ b/application/vendor/bin/psysh @@ -0,0 +1 @@ +../psy/psysh/bin/psysh \ No newline at end of file diff --git a/application/vendor/bin/upgrade-carbon b/application/vendor/bin/upgrade-carbon deleted file mode 100644 index bbe6340..0000000 --- a/application/vendor/bin/upgrade-carbon +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -dir=$(cd "${0%[/\\]*}" > /dev/null; cd '../nesbot/carbon/bin' && pwd) - -if [ -d /proc/cygdrive ]; then - case $(which php) in - $(readlink -n /proc/cygdrive)/*) - # We are in Cygwin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); - ;; - esac -fi - -"${dir}/upgrade-carbon" "$@" diff --git a/application/vendor/bin/upgrade-carbon b/application/vendor/bin/upgrade-carbon new file mode 120000 index 0000000..48def38 --- /dev/null +++ b/application/vendor/bin/upgrade-carbon @@ -0,0 +1 @@ +../nesbot/carbon/bin/upgrade-carbon \ No newline at end of file diff --git a/application/vendor/classpreloader/classpreloader/.github/FUNDING.yml b/application/vendor/classpreloader/classpreloader/.github/FUNDING.yml new file mode 100644 index 0000000..581f414 --- /dev/null +++ b/application/vendor/classpreloader/classpreloader/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: GrahamCampbell +tidelift: "packagist/classpreloader/classpreloader" diff --git a/application/vendor/composer/ClassLoader.php b/application/vendor/composer/ClassLoader.php index fce8549..03b9bb9 100644 --- a/application/vendor/composer/ClassLoader.php +++ b/application/vendor/composer/ClassLoader.php @@ -60,7 +60,7 @@ class ClassLoader public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); diff --git a/application/vendor/composer/autoload_classmap.php b/application/vendor/composer/autoload_classmap.php index 731bce8..c70e648 100644 --- a/application/vendor/composer/autoload_classmap.php +++ b/application/vendor/composer/autoload_classmap.php @@ -6,6 +6,7 @@ $baseDir = dirname($vendorDir); return array( + 'AddFieldsToServers' => $baseDir . '/database/migrations/2018_12_23_184255_AddFieldsToServers.php', 'App\\Commands\\Command' => $baseDir . '/app/Commands/Command.php', 'App\\Console\\Commands\\Inspire' => $baseDir . '/app/Console/Commands/Inspire.php', 'App\\Console\\Kernel' => $baseDir . '/app/Console/Kernel.php', @@ -41,6 +42,7 @@ 'App\\Http\\Middleware\\VerifyInstalled' => $baseDir . '/app/Http/Middleware/VerifyInstalled.php', 'App\\Http\\Middleware\\VerifyNotInstalled' => $baseDir . '/app/Http/Middleware/VerifyNotInstalled.php', 'App\\Http\\Middleware\\VerifyServers' => $baseDir . '/app/Http/Middleware/VerifyServers.php', + 'App\\Http\\Middleware\\VerifyServersUpgraded' => $baseDir . '/app/Http/Middleware/VerifyServersUpgraded.php', 'App\\Http\\Requests\\Request' => $baseDir . '/app/Http/Requests/Request.php', 'App\\IpBan' => $baseDir . '/app/IpBan.php', 'App\\IpBanRecord' => $baseDir . '/app/IpBanRecord.php', @@ -54,14 +56,12 @@ 'App\\PlayerNote' => $baseDir . '/app/PlayerNote.php', 'App\\PlayerWarning' => $baseDir . '/app/PlayerWarning.php', 'App\\Providers\\AppServiceProvider' => $baseDir . '/app/Providers/AppServiceProvider.php', - 'App\\Providers\\BusServiceProvider' => $baseDir . '/app/Providers/BusServiceProvider.php', 'App\\Providers\\ConfigServiceProvider' => $baseDir . '/app/Providers/ConfigServiceProvider.php', 'App\\Providers\\EventServiceProvider' => $baseDir . '/app/Providers/EventServiceProvider.php', 'App\\Providers\\HelperServiceProvider' => $baseDir . '/app/Providers/HelperServiceProvider.php', 'App\\Providers\\RouteServiceProvider' => $baseDir . '/app/Providers/RouteServiceProvider.php', 'App\\RecordBaseModel' => $baseDir . '/app/RecordBaseModel.php', 'App\\Server' => $baseDir . '/app/Server.php', - 'App\\Services\\Registrar' => $baseDir . '/app/Services/Registrar.php', 'App\\User' => $baseDir . '/app/User.php', 'Carbon\\Carbon' => $vendorDir . '/nesbot/carbon/src/Carbon/Carbon.php', 'Carbon\\CarbonInterval' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonInterval.php', @@ -85,6 +85,8 @@ 'ClassPreloader\\Parser\\FileVisitor' => $vendorDir . '/classpreloader/classpreloader/src/Parser/FileVisitor.php', 'ClassPreloader\\Parser\\NodeTraverser' => $vendorDir . '/classpreloader/classpreloader/src/Parser/NodeTraverser.php', 'ClassPreloader\\Parser\\StrictTypesVisitor' => $vendorDir . '/classpreloader/classpreloader/src/Parser/StrictTypesVisitor.php', + 'Collective\\Html\\Componentable' => $vendorDir . '/laravelcollective/html/src/Componentable.php', + 'Collective\\Html\\Eloquent\\FormAccessible' => $vendorDir . '/laravelcollective/html/src/Eloquent/FormAccessible.php', 'Collective\\Html\\FormBuilder' => $vendorDir . '/laravelcollective/html/src/FormBuilder.php', 'Collective\\Html\\FormFacade' => $vendorDir . '/laravelcollective/html/src/FormFacade.php', 'Collective\\Html\\HtmlBuilder' => $vendorDir . '/laravelcollective/html/src/HtmlBuilder.php', @@ -105,27 +107,87 @@ 'Cron\\YearField' => $vendorDir . '/mtdowling/cron-expression/src/Cron/YearField.php', 'DatabaseSeeder' => $baseDir . '/database/seeds/DatabaseSeeder.php', 'Doctrine\\Common\\Inflector\\Inflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php', - 'Dotenv' => $vendorDir . '/vlucas/phpdotenv/src/Dotenv.php', + 'Doctrine\\Inflector\\CachedWordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php', + 'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php', + 'Doctrine\\Inflector\\Inflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php', + 'Doctrine\\Inflector\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php', + 'Doctrine\\Inflector\\Language' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Language.php', + 'Doctrine\\Inflector\\LanguageInflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php', + 'Doctrine\\Inflector\\NoopWordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php', + 'Doctrine\\Inflector\\Rules\\English\\Inflectible' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\English\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\English\\Rules' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php', + 'Doctrine\\Inflector\\Rules\\English\\Uninflected' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\French\\Inflectible' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\French\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\French\\Rules' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php', + 'Doctrine\\Inflector\\Rules\\French\\Uninflected' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\Inflectible' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\Rules' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\Uninflected' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Pattern' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php', + 'Doctrine\\Inflector\\Rules\\Patterns' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\Inflectible' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\Rules' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\Uninflected' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Ruleset' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\Inflectible' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\Rules' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\Uninflected' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Substitution' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php', + 'Doctrine\\Inflector\\Rules\\Substitutions' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php', + 'Doctrine\\Inflector\\Rules\\Transformation' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php', + 'Doctrine\\Inflector\\Rules\\Transformations' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\Inflectible' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\InflectorFactory' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\Rules' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\Uninflected' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Word' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php', + 'Doctrine\\Inflector\\RulesetInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php', + 'Doctrine\\Inflector\\WordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php', + 'Dotenv\\Dotenv' => $vendorDir . '/vlucas/phpdotenv/src/Dotenv.php', + 'Dotenv\\Exception\\ExceptionInterface' => $vendorDir . '/vlucas/phpdotenv/src/Exception/ExceptionInterface.php', + 'Dotenv\\Exception\\InvalidCallbackException' => $vendorDir . '/vlucas/phpdotenv/src/Exception/InvalidCallbackException.php', + 'Dotenv\\Exception\\InvalidFileException' => $vendorDir . '/vlucas/phpdotenv/src/Exception/InvalidFileException.php', + 'Dotenv\\Exception\\InvalidPathException' => $vendorDir . '/vlucas/phpdotenv/src/Exception/InvalidPathException.php', + 'Dotenv\\Exception\\ValidationException' => $vendorDir . '/vlucas/phpdotenv/src/Exception/ValidationException.php', + 'Dotenv\\Loader' => $vendorDir . '/vlucas/phpdotenv/src/Loader.php', + 'Dotenv\\Parser' => $vendorDir . '/vlucas/phpdotenv/src/Parser.php', + 'Dotenv\\Validator' => $vendorDir . '/vlucas/phpdotenv/src/Validator.php', 'IlluminateQueueClosure' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/IlluminateQueueClosure.php', + 'Illuminate\\Auth\\Access\\AuthorizationException' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php', 'Illuminate\\Auth\\Access\\Gate' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Access/Gate.php', 'Illuminate\\Auth\\Access\\HandlesAuthorization' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php', 'Illuminate\\Auth\\Access\\Response' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Access/Response.php', - 'Illuminate\\Auth\\Access\\UnauthorizedException' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Access/UnauthorizedException.php', 'Illuminate\\Auth\\AuthManager' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/AuthManager.php', 'Illuminate\\Auth\\AuthServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php', 'Illuminate\\Auth\\Authenticatable' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Authenticatable.php', + 'Illuminate\\Auth\\AuthenticationException' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/AuthenticationException.php', 'Illuminate\\Auth\\Console\\ClearResetsCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php', + 'Illuminate\\Auth\\Console\\MakeAuthCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Console/MakeAuthCommand.php', + 'Illuminate\\Auth\\CreatesUserProviders' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php', 'Illuminate\\Auth\\DatabaseUserProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php', 'Illuminate\\Auth\\EloquentUserProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php', - 'Illuminate\\Auth\\GeneratorServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/GeneratorServiceProvider.php', + 'Illuminate\\Auth\\Events\\Attempting' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Events/Attempting.php', + 'Illuminate\\Auth\\Events\\Failed' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Events/Failed.php', + 'Illuminate\\Auth\\Events\\Lockout' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Events/Lockout.php', + 'Illuminate\\Auth\\Events\\Login' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Events/Login.php', + 'Illuminate\\Auth\\Events\\Logout' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Events/Logout.php', 'Illuminate\\Auth\\GenericUser' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/GenericUser.php', - 'Illuminate\\Auth\\Guard' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Guard.php', + 'Illuminate\\Auth\\GuardHelpers' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/GuardHelpers.php', 'Illuminate\\Auth\\Middleware\\AuthenticateWithBasicAuth' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php', 'Illuminate\\Auth\\Passwords\\CanResetPassword' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Passwords/CanResetPassword.php', 'Illuminate\\Auth\\Passwords\\DatabaseTokenRepository' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php', 'Illuminate\\Auth\\Passwords\\PasswordBroker' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php', + 'Illuminate\\Auth\\Passwords\\PasswordBrokerManager' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php', 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php', 'Illuminate\\Auth\\Passwords\\TokenRepositoryInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php', + 'Illuminate\\Auth\\RequestGuard' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/RequestGuard.php', + 'Illuminate\\Auth\\SessionGuard' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/SessionGuard.php', + 'Illuminate\\Auth\\TokenGuard' => $vendorDir . '/laravel/framework/src/Illuminate/Auth/TokenGuard.php', 'Illuminate\\Broadcasting\\BroadcastEvent' => $vendorDir . '/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php', 'Illuminate\\Broadcasting\\BroadcastManager' => $vendorDir . '/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php', 'Illuminate\\Broadcasting\\BroadcastServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Broadcasting/BroadcastServiceProvider.php', @@ -134,7 +196,6 @@ 'Illuminate\\Broadcasting\\Broadcasters\\RedisBroadcaster' => $vendorDir . '/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php', 'Illuminate\\Bus\\BusServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php', 'Illuminate\\Bus\\Dispatcher' => $vendorDir . '/laravel/framework/src/Illuminate/Bus/Dispatcher.php', - 'Illuminate\\Bus\\MarshalException' => $vendorDir . '/laravel/framework/src/Illuminate/Bus/MarshalException.php', 'Illuminate\\Bus\\Queueable' => $vendorDir . '/laravel/framework/src/Illuminate/Bus/Queueable.php', 'Illuminate\\Cache\\ApcStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/ApcStore.php', 'Illuminate\\Cache\\ApcWrapper' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/ApcWrapper.php', @@ -144,6 +205,10 @@ 'Illuminate\\Cache\\Console\\CacheTableCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php', 'Illuminate\\Cache\\Console\\ClearCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php', 'Illuminate\\Cache\\DatabaseStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/DatabaseStore.php', + 'Illuminate\\Cache\\Events\\CacheHit' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php', + 'Illuminate\\Cache\\Events\\CacheMissed' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php', + 'Illuminate\\Cache\\Events\\KeyForgotten' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Events/KeyForgotten.php', + 'Illuminate\\Cache\\Events\\KeyWritten' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Events/KeyWritten.php', 'Illuminate\\Cache\\FileStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/FileStore.php', 'Illuminate\\Cache\\MemcachedConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php', 'Illuminate\\Cache\\MemcachedStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/MemcachedStore.php', @@ -152,16 +217,16 @@ 'Illuminate\\Cache\\RedisStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/RedisStore.php', 'Illuminate\\Cache\\RedisTaggedCache' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php', 'Illuminate\\Cache\\Repository' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/Repository.php', + 'Illuminate\\Cache\\RetrievesMultipleKeys' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php', 'Illuminate\\Cache\\TagSet' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/TagSet.php', 'Illuminate\\Cache\\TaggableStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/TaggableStore.php', 'Illuminate\\Cache\\TaggedCache' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/TaggedCache.php', - 'Illuminate\\Cache\\WinCacheStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/WinCacheStore.php', - 'Illuminate\\Cache\\XCacheStore' => $vendorDir . '/laravel/framework/src/Illuminate/Cache/XCacheStore.php', 'Illuminate\\Config\\Repository' => $vendorDir . '/laravel/framework/src/Illuminate/Config/Repository.php', 'Illuminate\\Console\\AppNamespaceDetectorTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Console/AppNamespaceDetectorTrait.php', 'Illuminate\\Console\\Application' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Application.php', 'Illuminate\\Console\\Command' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Command.php', 'Illuminate\\Console\\ConfirmableTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php', + 'Illuminate\\Console\\Events\\ArtisanStarting' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Events/ArtisanStarting.php', 'Illuminate\\Console\\GeneratorCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Console/GeneratorCommand.php', 'Illuminate\\Console\\OutputStyle' => $vendorDir . '/laravel/framework/src/Illuminate/Console/OutputStyle.php', 'Illuminate\\Console\\Parser' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Parser.php', @@ -170,23 +235,25 @@ 'Illuminate\\Console\\Scheduling\\Event' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Scheduling/Event.php', 'Illuminate\\Console\\Scheduling\\Schedule' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php', 'Illuminate\\Console\\Scheduling\\ScheduleRunCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php', - 'Illuminate\\Container\\BindingResolutionException' => $vendorDir . '/laravel/framework/src/Illuminate/Container/BindingResolutionException.php', 'Illuminate\\Container\\Container' => $vendorDir . '/laravel/framework/src/Illuminate/Container/Container.php', 'Illuminate\\Container\\ContextualBindingBuilder' => $vendorDir . '/laravel/framework/src/Illuminate/Container/ContextualBindingBuilder.php', 'Illuminate\\Contracts\\Auth\\Access\\Authorizable' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/Access/Authorizable.php', 'Illuminate\\Contracts\\Auth\\Access\\Gate' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php', 'Illuminate\\Contracts\\Auth\\Authenticatable' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/Authenticatable.php', 'Illuminate\\Contracts\\Auth\\CanResetPassword' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/CanResetPassword.php', + 'Illuminate\\Contracts\\Auth\\Factory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/Factory.php', 'Illuminate\\Contracts\\Auth\\Guard' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/Guard.php', 'Illuminate\\Contracts\\Auth\\PasswordBroker' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/PasswordBroker.php', + 'Illuminate\\Contracts\\Auth\\PasswordBrokerFactory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/PasswordBrokerFactory.php', 'Illuminate\\Contracts\\Auth\\Registrar' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/Registrar.php', + 'Illuminate\\Contracts\\Auth\\StatefulGuard' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/StatefulGuard.php', + 'Illuminate\\Contracts\\Auth\\SupportsBasicAuth' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/SupportsBasicAuth.php', 'Illuminate\\Contracts\\Auth\\UserProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Auth/UserProvider.php', 'Illuminate\\Contracts\\Broadcasting\\Broadcaster' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/Broadcaster.php', 'Illuminate\\Contracts\\Broadcasting\\Factory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/Factory.php', 'Illuminate\\Contracts\\Broadcasting\\ShouldBroadcast' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/ShouldBroadcast.php', 'Illuminate\\Contracts\\Broadcasting\\ShouldBroadcastNow' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/ShouldBroadcastNow.php', 'Illuminate\\Contracts\\Bus\\Dispatcher' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Bus/Dispatcher.php', - 'Illuminate\\Contracts\\Bus\\HandlerResolver' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Bus/HandlerResolver.php', 'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Bus/QueueingDispatcher.php', 'Illuminate\\Contracts\\Bus\\SelfHandling' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Bus/SelfHandling.php', 'Illuminate\\Contracts\\Cache\\Factory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Cache/Factory.php', @@ -227,14 +294,12 @@ 'Illuminate\\Contracts\\Queue\\Job' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/Job.php', 'Illuminate\\Contracts\\Queue\\Monitor' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/Monitor.php', 'Illuminate\\Contracts\\Queue\\Queue' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/Queue.php', + 'Illuminate\\Contracts\\Queue\\QueueableCollection' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/QueueableCollection.php', 'Illuminate\\Contracts\\Queue\\QueueableEntity' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php', - 'Illuminate\\Contracts\\Queue\\ShouldBeQueued' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/ShouldBeQueued.php', 'Illuminate\\Contracts\\Queue\\ShouldQueue' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Queue/ShouldQueue.php', 'Illuminate\\Contracts\\Redis\\Database' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Redis/Database.php', - 'Illuminate\\Contracts\\Routing\\Middleware' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Routing/Middleware.php', 'Illuminate\\Contracts\\Routing\\Registrar' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Routing/Registrar.php', 'Illuminate\\Contracts\\Routing\\ResponseFactory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Routing/ResponseFactory.php', - 'Illuminate\\Contracts\\Routing\\TerminableMiddleware' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Routing/TerminableMiddleware.php', 'Illuminate\\Contracts\\Routing\\UrlGenerator' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Routing/UrlGenerator.php', 'Illuminate\\Contracts\\Routing\\UrlRoutable' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Routing/UrlRoutable.php', 'Illuminate\\Contracts\\Support\\Arrayable' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Support/Arrayable.php', @@ -301,9 +366,15 @@ 'Illuminate\\Database\\Eloquent\\Relations\\MorphToMany' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php', 'Illuminate\\Database\\Eloquent\\Relations\\Pivot' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php', 'Illuminate\\Database\\Eloquent\\Relations\\Relation' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php', + 'Illuminate\\Database\\Eloquent\\Scope' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php', 'Illuminate\\Database\\Eloquent\\ScopeInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/ScopeInterface.php', 'Illuminate\\Database\\Eloquent\\SoftDeletes' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletes.php', 'Illuminate\\Database\\Eloquent\\SoftDeletingScope' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php', + 'Illuminate\\Database\\Events\\ConnectionEvent' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php', + 'Illuminate\\Database\\Events\\QueryExecuted' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php', + 'Illuminate\\Database\\Events\\TransactionBeginning' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php', + 'Illuminate\\Database\\Events\\TransactionCommitted' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Events/TransactionCommitted.php', + 'Illuminate\\Database\\Events\\TransactionRolledBack' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Events/TransactionRolledBack.php', 'Illuminate\\Database\\Grammar' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Grammar.php', 'Illuminate\\Database\\MigrationServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Database/MigrationServiceProvider.php', 'Illuminate\\Database\\Migrations\\DatabaseMigrationRepository' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php', @@ -322,6 +393,7 @@ 'Illuminate\\Database\\Query\\Grammars\\SQLiteGrammar' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php', 'Illuminate\\Database\\Query\\Grammars\\SqlServerGrammar' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php', 'Illuminate\\Database\\Query\\JoinClause' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/JoinClause.php', + 'Illuminate\\Database\\Query\\JsonExpression' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/JsonExpression.php', 'Illuminate\\Database\\Query\\Processors\\MySqlProcessor' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php', 'Illuminate\\Database\\Query\\Processors\\PostgresProcessor' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php', 'Illuminate\\Database\\Query\\Processors\\Processor' => $vendorDir . '/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php', @@ -356,12 +428,14 @@ 'Illuminate\\Foundation\\Application' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Application.php', 'Illuminate\\Foundation\\Auth\\Access\\Authorizable' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/Access/Authorizable.php', 'Illuminate\\Foundation\\Auth\\Access\\AuthorizesRequests' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php', + 'Illuminate\\Foundation\\Auth\\Access\\AuthorizesResources' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesResources.php', 'Illuminate\\Foundation\\Auth\\AuthenticatesAndRegistersUsers' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php', 'Illuminate\\Foundation\\Auth\\AuthenticatesUsers' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php', 'Illuminate\\Foundation\\Auth\\RedirectsUsers' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/RedirectsUsers.php', 'Illuminate\\Foundation\\Auth\\RegistersUsers' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php', 'Illuminate\\Foundation\\Auth\\ResetsPasswords' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php', 'Illuminate\\Foundation\\Auth\\ThrottlesLogins' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/ThrottlesLogins.php', + 'Illuminate\\Foundation\\Auth\\User' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Auth/User.php', 'Illuminate\\Foundation\\Bootstrap\\BootProviders' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php', 'Illuminate\\Foundation\\Bootstrap\\ConfigureLogging' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php', 'Illuminate\\Foundation\\Bootstrap\\DetectEnvironment' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php', @@ -370,13 +444,10 @@ 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php', 'Illuminate\\Foundation\\Bootstrap\\SetRequestForConsole' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php', - 'Illuminate\\Foundation\\Bus\\DispatchesCommands' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesCommands.php', 'Illuminate\\Foundation\\Bus\\DispatchesJobs' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php', - 'Illuminate\\Foundation\\Composer' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Composer.php', 'Illuminate\\Foundation\\ComposerScripts' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php', 'Illuminate\\Foundation\\Console\\AppNameCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php', 'Illuminate\\Foundation\\Console\\ClearCompiledCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php', - 'Illuminate\\Foundation\\Console\\CommandMakeCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/CommandMakeCommand.php', 'Illuminate\\Foundation\\Console\\ConfigCacheCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php', 'Illuminate\\Foundation\\Console\\ConfigClearCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/ConfigClearCommand.php', 'Illuminate\\Foundation\\Console\\ConsoleMakeCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/ConsoleMakeCommand.php', @@ -384,8 +455,6 @@ 'Illuminate\\Foundation\\Console\\EnvironmentCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentCommand.php', 'Illuminate\\Foundation\\Console\\EventGenerateCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/EventGenerateCommand.php', 'Illuminate\\Foundation\\Console\\EventMakeCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/EventMakeCommand.php', - 'Illuminate\\Foundation\\Console\\HandlerCommandCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/HandlerCommandCommand.php', - 'Illuminate\\Foundation\\Console\\HandlerEventCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/HandlerEventCommand.php', 'Illuminate\\Foundation\\Console\\IlluminateCaster' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/IlluminateCaster.php', 'Illuminate\\Foundation\\Console\\JobMakeCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php', 'Illuminate\\Foundation\\Console\\Kernel' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php', @@ -410,6 +479,7 @@ 'Illuminate\\Foundation\\Exceptions\\Handler' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php', 'Illuminate\\Foundation\\Http\\FormRequest' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php', 'Illuminate\\Foundation\\Http\\Kernel' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php', + 'Illuminate\\Foundation\\Http\\Middleware\\Authorize' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/Authorize.php', 'Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php', 'Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php', 'Illuminate\\Foundation\\Http\\Middleware\\VerifyPostSize' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyPostSize.php', @@ -418,22 +488,38 @@ 'Illuminate\\Foundation\\Providers\\ArtisanServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php', 'Illuminate\\Foundation\\Providers\\ComposerServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php', 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php', - 'Illuminate\\Foundation\\Providers\\FormRequestServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php', 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php', 'Illuminate\\Foundation\\Support\\Providers\\AuthServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Support/Providers/AuthServiceProvider.php', 'Illuminate\\Foundation\\Support\\Providers\\EventServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php', 'Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php', - 'Illuminate\\Foundation\\Testing\\ApplicationTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/ApplicationTrait.php', - 'Illuminate\\Foundation\\Testing\\AssertionsTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/AssertionsTrait.php', - 'Illuminate\\Foundation\\Testing\\CrawlerTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/CrawlerTrait.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\ImpersonatesUsers' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithAuthentication' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithConsole' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithContainer' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithDatabase' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithPages' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithSession' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\MakesHttpRequests' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\MocksApplicationServices' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\FormFieldConstraint' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/FormFieldConstraint.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasElement' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasElement.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasInElement' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInElement.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasLink' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasLink.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasSource' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasSource.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasText' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasText.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasValue' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasValue.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\IsChecked' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsChecked.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\IsSelected' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsSelected.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\PageConstraint' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/PageConstraint.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\ReversePageConstraint' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/ReversePageConstraint.php', 'Illuminate\\Foundation\\Testing\\DatabaseMigrations' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php', 'Illuminate\\Foundation\\Testing\\DatabaseTransactions' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php', 'Illuminate\\Foundation\\Testing\\HttpException' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/HttpException.php', - 'Illuminate\\Foundation\\Testing\\InteractsWithPages' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/InteractsWithPages.php', 'Illuminate\\Foundation\\Testing\\TestCase' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php', 'Illuminate\\Foundation\\Testing\\WithoutEvents' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/WithoutEvents.php', 'Illuminate\\Foundation\\Testing\\WithoutMiddleware' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddleware.php', 'Illuminate\\Foundation\\Validation\\ValidatesRequests' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php', + 'Illuminate\\Foundation\\Validation\\ValidationException' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/Validation/ValidationException.php', 'Illuminate\\Hashing\\BcryptHasher' => $vendorDir . '/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php', 'Illuminate\\Hashing\\HashServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php', 'Illuminate\\Http\\Exception\\HttpResponseException' => $vendorDir . '/laravel/framework/src/Illuminate/Http/Exception/HttpResponseException.php', @@ -445,7 +531,9 @@ 'Illuminate\\Http\\Request' => $vendorDir . '/laravel/framework/src/Illuminate/Http/Request.php', 'Illuminate\\Http\\Response' => $vendorDir . '/laravel/framework/src/Illuminate/Http/Response.php', 'Illuminate\\Http\\ResponseTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Http/ResponseTrait.php', + 'Illuminate\\Http\\UploadedFile' => $vendorDir . '/laravel/framework/src/Illuminate/Http/UploadedFile.php', 'Illuminate\\Log\\Writer' => $vendorDir . '/laravel/framework/src/Illuminate/Log/Writer.php', + 'Illuminate\\Mail\\Events\\MessageSending' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php', 'Illuminate\\Mail\\MailServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php', 'Illuminate\\Mail\\Mailer' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Mailer.php', 'Illuminate\\Mail\\Message' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Message.php', @@ -454,13 +542,17 @@ 'Illuminate\\Mail\\Transport\\MailgunTransport' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php', 'Illuminate\\Mail\\Transport\\MandrillTransport' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Transport/MandrillTransport.php', 'Illuminate\\Mail\\Transport\\SesTransport' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php', + 'Illuminate\\Mail\\Transport\\SparkPostTransport' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Transport/SparkPostTransport.php', 'Illuminate\\Mail\\Transport\\Transport' => $vendorDir . '/laravel/framework/src/Illuminate/Mail/Transport/Transport.php', 'Illuminate\\Pagination\\AbstractPaginator' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php', + 'Illuminate\\Pagination\\BootstrapFourNextPreviousButtonRendererTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/BootstrapFourNextPreviousButtonRendererTrait.php', + 'Illuminate\\Pagination\\BootstrapFourPresenter' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/BootstrapFourPresenter.php', 'Illuminate\\Pagination\\BootstrapThreeNextPreviousButtonRendererTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/BootstrapThreeNextPreviousButtonRendererTrait.php', 'Illuminate\\Pagination\\BootstrapThreePresenter' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/BootstrapThreePresenter.php', 'Illuminate\\Pagination\\LengthAwarePaginator' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php', 'Illuminate\\Pagination\\PaginationServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php', 'Illuminate\\Pagination\\Paginator' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/Paginator.php', + 'Illuminate\\Pagination\\SimpleBootstrapFourPresenter' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapFourPresenter.php', 'Illuminate\\Pagination\\SimpleBootstrapThreePresenter' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapThreePresenter.php', 'Illuminate\\Pagination\\UrlWindow' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/UrlWindow.php', 'Illuminate\\Pagination\\UrlWindowPresenterTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Pagination/UrlWindowPresenterTrait.php', @@ -473,7 +565,6 @@ 'Illuminate\\Queue\\Connectors\\BeanstalkdConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php', 'Illuminate\\Queue\\Connectors\\ConnectorInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php', 'Illuminate\\Queue\\Connectors\\DatabaseConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/DatabaseConnector.php', - 'Illuminate\\Queue\\Connectors\\IronConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/IronConnector.php', 'Illuminate\\Queue\\Connectors\\NullConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/NullConnector.php', 'Illuminate\\Queue\\Connectors\\RedisConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/RedisConnector.php', 'Illuminate\\Queue\\Connectors\\SqsConnector' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php', @@ -486,18 +577,20 @@ 'Illuminate\\Queue\\Console\\ListenCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php', 'Illuminate\\Queue\\Console\\RestartCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Console/RestartCommand.php', 'Illuminate\\Queue\\Console\\RetryCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php', - 'Illuminate\\Queue\\Console\\SubscribeCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Console/SubscribeCommand.php', 'Illuminate\\Queue\\Console\\TableCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php', 'Illuminate\\Queue\\Console\\WorkCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php', 'Illuminate\\Queue\\DatabaseQueue' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php', + 'Illuminate\\Queue\\Events\\JobExceptionOccurred' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php', + 'Illuminate\\Queue\\Events\\JobFailed' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php', + 'Illuminate\\Queue\\Events\\JobProcessed' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php', + 'Illuminate\\Queue\\Events\\JobProcessing' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php', + 'Illuminate\\Queue\\Events\\WorkerStopping' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php', 'Illuminate\\Queue\\Failed\\DatabaseFailedJobProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php', 'Illuminate\\Queue\\Failed\\FailedJobProviderInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php', 'Illuminate\\Queue\\Failed\\NullFailedJobProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Failed/NullFailedJobProvider.php', 'Illuminate\\Queue\\InteractsWithQueue' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php', - 'Illuminate\\Queue\\IronQueue' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/IronQueue.php', 'Illuminate\\Queue\\Jobs\\BeanstalkdJob' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Jobs/BeanstalkdJob.php', 'Illuminate\\Queue\\Jobs\\DatabaseJob' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php', - 'Illuminate\\Queue\\Jobs\\IronJob' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php', 'Illuminate\\Queue\\Jobs\\Job' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Jobs/Job.php', 'Illuminate\\Queue\\Jobs\\RedisJob' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Jobs/RedisJob.php', 'Illuminate\\Queue\\Jobs\\SqsJob' => $vendorDir . '/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php', @@ -519,13 +612,16 @@ 'Illuminate\\Routing\\Controller' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Controller.php', 'Illuminate\\Routing\\ControllerDispatcher' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php', 'Illuminate\\Routing\\ControllerInspector' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/ControllerInspector.php', - 'Illuminate\\Routing\\ControllerServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php', - 'Illuminate\\Routing\\GeneratorServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/GeneratorServiceProvider.php', + 'Illuminate\\Routing\\ControllerMiddlewareOptions' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php', + 'Illuminate\\Routing\\Events\\RouteMatched' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php', + 'Illuminate\\Routing\\Exceptions\\UrlGenerationException' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php', 'Illuminate\\Routing\\Matching\\HostValidator' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php', 'Illuminate\\Routing\\Matching\\MethodValidator' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Matching/MethodValidator.php', 'Illuminate\\Routing\\Matching\\SchemeValidator' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Matching/SchemeValidator.php', 'Illuminate\\Routing\\Matching\\UriValidator' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Matching/UriValidator.php', 'Illuminate\\Routing\\Matching\\ValidatorInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php', + 'Illuminate\\Routing\\Middleware\\ThrottleRequests' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php', + 'Illuminate\\Routing\\Pipeline' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Pipeline.php', 'Illuminate\\Routing\\Redirector' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/Redirector.php', 'Illuminate\\Routing\\ResourceRegistrar' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php', 'Illuminate\\Routing\\ResponseFactory' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/ResponseFactory.php', @@ -536,13 +632,13 @@ 'Illuminate\\Routing\\RoutingServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php', 'Illuminate\\Routing\\UrlGenerator' => $vendorDir . '/laravel/framework/src/Illuminate/Routing/UrlGenerator.php', 'Illuminate\\Session\\CacheBasedSessionHandler' => $vendorDir . '/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php', - 'Illuminate\\Session\\CommandsServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Session/CommandsServiceProvider.php', 'Illuminate\\Session\\Console\\SessionTableCommand' => $vendorDir . '/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php', 'Illuminate\\Session\\CookieSessionHandler' => $vendorDir . '/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php', 'Illuminate\\Session\\DatabaseSessionHandler' => $vendorDir . '/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php', 'Illuminate\\Session\\EncryptedStore' => $vendorDir . '/laravel/framework/src/Illuminate/Session/EncryptedStore.php', 'Illuminate\\Session\\ExistenceAwareInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Session/ExistenceAwareInterface.php', 'Illuminate\\Session\\FileSessionHandler' => $vendorDir . '/laravel/framework/src/Illuminate/Session/FileSessionHandler.php', + 'Illuminate\\Session\\LegacyDatabaseSessionHandler' => $vendorDir . '/laravel/framework/src/Illuminate/Session/LegacyDatabaseSessionHandler.php', 'Illuminate\\Session\\Middleware\\StartSession' => $vendorDir . '/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php', 'Illuminate\\Session\\SessionInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Session/SessionInterface.php', 'Illuminate\\Session\\SessionManager' => $vendorDir . '/laravel/framework/src/Illuminate/Session/SessionManager.php', @@ -553,6 +649,7 @@ 'Illuminate\\Support\\Arr' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Arr.php', 'Illuminate\\Support\\ClassLoader' => $vendorDir . '/laravel/framework/src/Illuminate/Support/ClassLoader.php', 'Illuminate\\Support\\Collection' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Collection.php', + 'Illuminate\\Support\\Composer' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Composer.php', 'Illuminate\\Support\\Debug\\Dumper' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Debug/Dumper.php', 'Illuminate\\Support\\Debug\\HtmlDumper' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Debug/HtmlDumper.php', 'Illuminate\\Support\\Facades\\App' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Facades/App.php', @@ -598,6 +695,7 @@ 'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php', 'Illuminate\\Support\\Traits\\Macroable' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Traits/Macroable.php', 'Illuminate\\Support\\ViewErrorBag' => $vendorDir . '/laravel/framework/src/Illuminate/Support/ViewErrorBag.php', + 'Illuminate\\Translation\\ArrayLoader' => $vendorDir . '/laravel/framework/src/Illuminate/Translation/ArrayLoader.php', 'Illuminate\\Translation\\FileLoader' => $vendorDir . '/laravel/framework/src/Illuminate/Translation/FileLoader.php', 'Illuminate\\Translation\\LoaderInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Translation/LoaderInterface.php', 'Illuminate\\Translation\\TranslationServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php', @@ -606,6 +704,7 @@ 'Illuminate\\Validation\\Factory' => $vendorDir . '/laravel/framework/src/Illuminate/Validation/Factory.php', 'Illuminate\\Validation\\PresenceVerifierInterface' => $vendorDir . '/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php', 'Illuminate\\Validation\\ValidatesWhenResolvedTrait' => $vendorDir . '/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php', + 'Illuminate\\Validation\\ValidationException' => $vendorDir . '/laravel/framework/src/Illuminate/Validation/ValidationException.php', 'Illuminate\\Validation\\ValidationServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php', 'Illuminate\\Validation\\Validator' => $vendorDir . '/laravel/framework/src/Illuminate/Validation/Validator.php', 'Illuminate\\View\\Compilers\\BladeCompiler' => $vendorDir . '/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php', @@ -643,15 +742,19 @@ 'League\\Flysystem\\Adapter\\SynologyFtp' => $vendorDir . '/league/flysystem/src/Adapter/SynologyFtp.php', 'League\\Flysystem\\Config' => $vendorDir . '/league/flysystem/src/Config.php', 'League\\Flysystem\\ConfigAwareTrait' => $vendorDir . '/league/flysystem/src/ConfigAwareTrait.php', + 'League\\Flysystem\\ConnectionErrorException' => $vendorDir . '/league/flysystem/src/ConnectionErrorException.php', + 'League\\Flysystem\\ConnectionRuntimeException' => $vendorDir . '/league/flysystem/src/ConnectionRuntimeException.php', 'League\\Flysystem\\Directory' => $vendorDir . '/league/flysystem/src/Directory.php', 'League\\Flysystem\\Exception' => $vendorDir . '/league/flysystem/src/Exception.php', 'League\\Flysystem\\File' => $vendorDir . '/league/flysystem/src/File.php', 'League\\Flysystem\\FileExistsException' => $vendorDir . '/league/flysystem/src/FileExistsException.php', 'League\\Flysystem\\FileNotFoundException' => $vendorDir . '/league/flysystem/src/FileNotFoundException.php', 'League\\Flysystem\\Filesystem' => $vendorDir . '/league/flysystem/src/Filesystem.php', + 'League\\Flysystem\\FilesystemException' => $vendorDir . '/league/flysystem/src/FilesystemException.php', 'League\\Flysystem\\FilesystemInterface' => $vendorDir . '/league/flysystem/src/FilesystemInterface.php', 'League\\Flysystem\\FilesystemNotFoundException' => $vendorDir . '/league/flysystem/src/FilesystemNotFoundException.php', 'League\\Flysystem\\Handler' => $vendorDir . '/league/flysystem/src/Handler.php', + 'League\\Flysystem\\InvalidRootException' => $vendorDir . '/league/flysystem/src/InvalidRootException.php', 'League\\Flysystem\\MountManager' => $vendorDir . '/league/flysystem/src/MountManager.php', 'League\\Flysystem\\NotSupportedException' => $vendorDir . '/league/flysystem/src/NotSupportedException.php', 'League\\Flysystem\\PluginInterface' => $vendorDir . '/league/flysystem/src/PluginInterface.php', @@ -673,6 +776,12 @@ 'League\\Flysystem\\Util\\ContentListingFormatter' => $vendorDir . '/league/flysystem/src/Util/ContentListingFormatter.php', 'League\\Flysystem\\Util\\MimeType' => $vendorDir . '/league/flysystem/src/Util/MimeType.php', 'League\\Flysystem\\Util\\StreamHasher' => $vendorDir . '/league/flysystem/src/Util/StreamHasher.php', + 'League\\MimeTypeDetection\\EmptyExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\ExtensionMimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/ExtensionMimeTypeDetector.php', + 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/ExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\FinfoMimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/FinfoMimeTypeDetector.php', + 'League\\MimeTypeDetection\\GeneratedExtensionToMimeTypeMap' => $vendorDir . '/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\MimeTypeDetector' => $vendorDir . '/league/mime-type-detection/src/MimeTypeDetector.php', 'Monolog\\ErrorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/ErrorHandler.php', 'Monolog\\Formatter\\ChromePHPFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php', 'Monolog\\Formatter\\ElasticaFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php', @@ -975,7 +1084,7 @@ 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php', 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'Psy\\Autoloader' => $vendorDir . '/psy/psysh/src/Psy/Autoloader.php', @@ -1083,9 +1192,6 @@ 'Psy\\VarDumper\\Dumper' => $vendorDir . '/psy/psysh/src/Psy/VarDumper/Dumper.php', 'Psy\\VarDumper\\Presenter' => $vendorDir . '/psy/psysh/src/Psy/VarDumper/Presenter.php', 'Psy\\VarDumper\\PresenterAware' => $vendorDir . '/psy/psysh/src/Psy/VarDumper/PresenterAware.php', - 'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Resources/stubs/SessionHandlerInterface.php', - 'Stringy\\StaticStringy' => $vendorDir . '/danielstjules/stringy/src/StaticStringy.php', - 'Stringy\\Stringy' => $vendorDir . '/danielstjules/stringy/src/Stringy.php', 'SuperClosure\\Analyzer\\AstAnalyzer' => $vendorDir . '/jeremeamia/superclosure/src/Analyzer/AstAnalyzer.php', 'SuperClosure\\Analyzer\\ClosureAnalyzer' => $vendorDir . '/jeremeamia/superclosure/src/Analyzer/ClosureAnalyzer.php', 'SuperClosure\\Analyzer\\Token' => $vendorDir . '/jeremeamia/superclosure/src/Analyzer/Token.php', @@ -1116,6 +1222,11 @@ 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => $vendorDir . '/symfony/console/Event/ConsoleEvent.php', 'Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent' => $vendorDir . '/symfony/console/Event/ConsoleExceptionEvent.php', 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => $vendorDir . '/symfony/console/Event/ConsoleTerminateEvent.php', + 'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => $vendorDir . '/symfony/console/Exception/CommandNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/console/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/console/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => $vendorDir . '/symfony/console/Exception/InvalidOptionException.php', + 'Symfony\\Component\\Console\\Exception\\LogicException' => $vendorDir . '/symfony/console/Exception/LogicException.php', 'Symfony\\Component\\Console\\Exception\\RuntimeException' => $vendorDir . '/symfony/console/Exception/RuntimeException.php', 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $vendorDir . '/symfony/console/Formatter/OutputFormatter.php', 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterInterface.php', @@ -1124,7 +1235,6 @@ 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleStack.php', 'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => $vendorDir . '/symfony/console/Helper/DebugFormatterHelper.php', 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => $vendorDir . '/symfony/console/Helper/DescriptorHelper.php', - 'Symfony\\Component\\Console\\Helper\\DialogHelper' => $vendorDir . '/symfony/console/Helper/DialogHelper.php', 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => $vendorDir . '/symfony/console/Helper/FormatterHelper.php', 'Symfony\\Component\\Console\\Helper\\Helper' => $vendorDir . '/symfony/console/Helper/Helper.php', 'Symfony\\Component\\Console\\Helper\\HelperInterface' => $vendorDir . '/symfony/console/Helper/HelperInterface.php', @@ -1132,12 +1242,11 @@ 'Symfony\\Component\\Console\\Helper\\InputAwareHelper' => $vendorDir . '/symfony/console/Helper/InputAwareHelper.php', 'Symfony\\Component\\Console\\Helper\\ProcessHelper' => $vendorDir . '/symfony/console/Helper/ProcessHelper.php', 'Symfony\\Component\\Console\\Helper\\ProgressBar' => $vendorDir . '/symfony/console/Helper/ProgressBar.php', - 'Symfony\\Component\\Console\\Helper\\ProgressHelper' => $vendorDir . '/symfony/console/Helper/ProgressHelper.php', + 'Symfony\\Component\\Console\\Helper\\ProgressIndicator' => $vendorDir . '/symfony/console/Helper/ProgressIndicator.php', 'Symfony\\Component\\Console\\Helper\\QuestionHelper' => $vendorDir . '/symfony/console/Helper/QuestionHelper.php', 'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => $vendorDir . '/symfony/console/Helper/SymfonyQuestionHelper.php', 'Symfony\\Component\\Console\\Helper\\Table' => $vendorDir . '/symfony/console/Helper/Table.php', 'Symfony\\Component\\Console\\Helper\\TableCell' => $vendorDir . '/symfony/console/Helper/TableCell.php', - 'Symfony\\Component\\Console\\Helper\\TableHelper' => $vendorDir . '/symfony/console/Helper/TableHelper.php', 'Symfony\\Component\\Console\\Helper\\TableSeparator' => $vendorDir . '/symfony/console/Helper/TableSeparator.php', 'Symfony\\Component\\Console\\Helper\\TableStyle' => $vendorDir . '/symfony/console/Helper/TableStyle.php', 'Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Input/ArgvInput.php', @@ -1160,13 +1269,11 @@ 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => $vendorDir . '/symfony/console/Question/ChoiceQuestion.php', 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => $vendorDir . '/symfony/console/Question/ConfirmationQuestion.php', 'Symfony\\Component\\Console\\Question\\Question' => $vendorDir . '/symfony/console/Question/Question.php', - 'Symfony\\Component\\Console\\Shell' => $vendorDir . '/symfony/console/Shell.php', 'Symfony\\Component\\Console\\Style\\OutputStyle' => $vendorDir . '/symfony/console/Style/OutputStyle.php', 'Symfony\\Component\\Console\\Style\\StyleInterface' => $vendorDir . '/symfony/console/Style/StyleInterface.php', 'Symfony\\Component\\Console\\Style\\SymfonyStyle' => $vendorDir . '/symfony/console/Style/SymfonyStyle.php', 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => $vendorDir . '/symfony/console/Tester/ApplicationTester.php', 'Symfony\\Component\\Console\\Tester\\CommandTester' => $vendorDir . '/symfony/console/Tester/CommandTester.php', - 'Symfony\\Component\\CssSelector\\CssSelector' => $vendorDir . '/symfony/css-selector/CssSelector.php', 'Symfony\\Component\\CssSelector\\CssSelectorConverter' => $vendorDir . '/symfony/css-selector/CssSelectorConverter.php', 'Symfony\\Component\\CssSelector\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/css-selector/Exception/ExceptionInterface.php', 'Symfony\\Component\\CssSelector\\Exception\\ExpressionErrorException' => $vendorDir . '/symfony/css-selector/Exception/ExpressionErrorException.php', @@ -1215,14 +1322,13 @@ 'Symfony\\Component\\CssSelector\\XPath\\Translator' => $vendorDir . '/symfony/css-selector/XPath/Translator.php', 'Symfony\\Component\\CssSelector\\XPath\\TranslatorInterface' => $vendorDir . '/symfony/css-selector/XPath/TranslatorInterface.php', 'Symfony\\Component\\CssSelector\\XPath\\XPathExpr' => $vendorDir . '/symfony/css-selector/XPath/XPathExpr.php', + 'Symfony\\Component\\Debug\\BufferingLogger' => $vendorDir . '/symfony/debug/BufferingLogger.php', 'Symfony\\Component\\Debug\\Debug' => $vendorDir . '/symfony/debug/Debug.php', 'Symfony\\Component\\Debug\\DebugClassLoader' => $vendorDir . '/symfony/debug/DebugClassLoader.php', 'Symfony\\Component\\Debug\\ErrorHandler' => $vendorDir . '/symfony/debug/ErrorHandler.php', - 'Symfony\\Component\\Debug\\ErrorHandlerCanary' => $vendorDir . '/symfony/debug/ErrorHandler.php', 'Symfony\\Component\\Debug\\ExceptionHandler' => $vendorDir . '/symfony/debug/ExceptionHandler.php', 'Symfony\\Component\\Debug\\Exception\\ClassNotFoundException' => $vendorDir . '/symfony/debug/Exception/ClassNotFoundException.php', 'Symfony\\Component\\Debug\\Exception\\ContextErrorException' => $vendorDir . '/symfony/debug/Exception/ContextErrorException.php', - 'Symfony\\Component\\Debug\\Exception\\DummyException' => $vendorDir . '/symfony/debug/Exception/DummyException.php', 'Symfony\\Component\\Debug\\Exception\\FatalErrorException' => $vendorDir . '/symfony/debug/Exception/FatalErrorException.php', 'Symfony\\Component\\Debug\\Exception\\FatalThrowableError' => $vendorDir . '/symfony/debug/Exception/FatalThrowableError.php', 'Symfony\\Component\\Debug\\Exception\\FlattenException' => $vendorDir . '/symfony/debug/Exception/FlattenException.php', @@ -1233,6 +1339,7 @@ 'Symfony\\Component\\Debug\\FatalErrorHandler\\FatalErrorHandlerInterface' => $vendorDir . '/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php', 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedFunctionFatalErrorHandler' => $vendorDir . '/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php', 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedMethodFatalErrorHandler' => $vendorDir . '/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php', + 'Symfony\\Component\\DomCrawler\\AbstractUriElement' => $vendorDir . '/symfony/dom-crawler/AbstractUriElement.php', 'Symfony\\Component\\DomCrawler\\Crawler' => $vendorDir . '/symfony/dom-crawler/Crawler.php', 'Symfony\\Component\\DomCrawler\\Field\\ChoiceFormField' => $vendorDir . '/symfony/dom-crawler/Field/ChoiceFormField.php', 'Symfony\\Component\\DomCrawler\\Field\\FileFormField' => $vendorDir . '/symfony/dom-crawler/Field/FileFormField.php', @@ -1241,11 +1348,13 @@ 'Symfony\\Component\\DomCrawler\\Field\\TextareaFormField' => $vendorDir . '/symfony/dom-crawler/Field/TextareaFormField.php', 'Symfony\\Component\\DomCrawler\\Form' => $vendorDir . '/symfony/dom-crawler/Form.php', 'Symfony\\Component\\DomCrawler\\FormFieldRegistry' => $vendorDir . '/symfony/dom-crawler/FormFieldRegistry.php', + 'Symfony\\Component\\DomCrawler\\Image' => $vendorDir . '/symfony/dom-crawler/Image.php', 'Symfony\\Component\\DomCrawler\\Link' => $vendorDir . '/symfony/dom-crawler/Link.php', 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/ContainerAwareEventDispatcher.php', 'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php', 'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcherInterface' => $vendorDir . '/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php', 'Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener' => $vendorDir . '/symfony/event-dispatcher/Debug/WrappedListener.php', + 'Symfony\\Component\\EventDispatcher\\DependencyInjection\\ExtractingEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php', 'Symfony\\Component\\EventDispatcher\\DependencyInjection\\RegisterListenersPass' => $vendorDir . '/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php', 'Symfony\\Component\\EventDispatcher\\Event' => $vendorDir . '/symfony/event-dispatcher/Event.php', 'Symfony\\Component\\EventDispatcher\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/EventDispatcher.php', @@ -1253,31 +1362,17 @@ 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface' => $vendorDir . '/symfony/event-dispatcher/EventSubscriberInterface.php', 'Symfony\\Component\\EventDispatcher\\GenericEvent' => $vendorDir . '/symfony/event-dispatcher/GenericEvent.php', 'Symfony\\Component\\EventDispatcher\\ImmutableEventDispatcher' => $vendorDir . '/symfony/event-dispatcher/ImmutableEventDispatcher.php', - 'Symfony\\Component\\Finder\\Adapter\\AbstractAdapter' => $vendorDir . '/symfony/finder/Adapter/AbstractAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\AbstractFindAdapter' => $vendorDir . '/symfony/finder/Adapter/AbstractFindAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\AdapterInterface' => $vendorDir . '/symfony/finder/Adapter/AdapterInterface.php', - 'Symfony\\Component\\Finder\\Adapter\\BsdFindAdapter' => $vendorDir . '/symfony/finder/Adapter/BsdFindAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\GnuFindAdapter' => $vendorDir . '/symfony/finder/Adapter/GnuFindAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\PhpAdapter' => $vendorDir . '/symfony/finder/Adapter/PhpAdapter.php', 'Symfony\\Component\\Finder\\Comparator\\Comparator' => $vendorDir . '/symfony/finder/Comparator/Comparator.php', 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => $vendorDir . '/symfony/finder/Comparator/DateComparator.php', 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => $vendorDir . '/symfony/finder/Comparator/NumberComparator.php', 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/finder/Exception/AccessDeniedException.php', - 'Symfony\\Component\\Finder\\Exception\\AdapterFailureException' => $vendorDir . '/symfony/finder/Exception/AdapterFailureException.php', 'Symfony\\Component\\Finder\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/finder/Exception/ExceptionInterface.php', - 'Symfony\\Component\\Finder\\Exception\\OperationNotPermitedException' => $vendorDir . '/symfony/finder/Exception/OperationNotPermitedException.php', - 'Symfony\\Component\\Finder\\Exception\\ShellCommandFailureException' => $vendorDir . '/symfony/finder/Exception/ShellCommandFailureException.php', - 'Symfony\\Component\\Finder\\Expression\\Expression' => $vendorDir . '/symfony/finder/Expression/Expression.php', - 'Symfony\\Component\\Finder\\Expression\\Glob' => $vendorDir . '/symfony/finder/Expression/Glob.php', - 'Symfony\\Component\\Finder\\Expression\\Regex' => $vendorDir . '/symfony/finder/Expression/Regex.php', - 'Symfony\\Component\\Finder\\Expression\\ValueInterface' => $vendorDir . '/symfony/finder/Expression/ValueInterface.php', 'Symfony\\Component\\Finder\\Finder' => $vendorDir . '/symfony/finder/Finder.php', 'Symfony\\Component\\Finder\\Glob' => $vendorDir . '/symfony/finder/Glob.php', 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => $vendorDir . '/symfony/finder/Iterator/CustomFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DateRangeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DepthRangeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => $vendorDir . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FilePathsIterator' => $vendorDir . '/symfony/finder/Iterator/FilePathsIterator.php', 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FileTypeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilecontentFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilenameFilterIterator.php', @@ -1287,8 +1382,6 @@ 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => $vendorDir . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php', 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/SizeRangeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => $vendorDir . '/symfony/finder/Iterator/SortableIterator.php', - 'Symfony\\Component\\Finder\\Shell\\Command' => $vendorDir . '/symfony/finder/Shell/Command.php', - 'Symfony\\Component\\Finder\\Shell\\Shell' => $vendorDir . '/symfony/finder/Shell/Shell.php', 'Symfony\\Component\\Finder\\SplFileInfo' => $vendorDir . '/symfony/finder/SplFileInfo.php', 'Symfony\\Component\\HttpFoundation\\AcceptHeader' => $vendorDir . '/symfony/http-foundation/AcceptHeader.php', 'Symfony\\Component\\HttpFoundation\\AcceptHeaderItem' => $vendorDir . '/symfony/http-foundation/AcceptHeaderItem.php', @@ -1333,7 +1426,6 @@ 'Symfony\\Component\\HttpFoundation\\Session\\Session' => $vendorDir . '/symfony/http-foundation/Session/Session.php', 'Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface' => $vendorDir . '/symfony/http-foundation/Session/SessionBagInterface.php', 'Symfony\\Component\\HttpFoundation\\Session\\SessionInterface' => $vendorDir . '/symfony/http-foundation/Session/SessionInterface.php', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\LegacyPdoSessionHandler' => $vendorDir . '/symfony/http-foundation/Session/Storage/Handler/LegacyPdoSessionHandler.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcacheSessionHandler' => $vendorDir . '/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcachedSessionHandler' => $vendorDir . '/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MongoDbSessionHandler' => $vendorDir . '/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php', @@ -1367,6 +1459,7 @@ 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver' => $vendorDir . '/symfony/http-kernel/Controller/ControllerResolver.php', 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface' => $vendorDir . '/symfony/http-kernel/Controller/ControllerResolverInterface.php', 'Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver' => $vendorDir . '/symfony/http-kernel/Controller/TraceableControllerResolver.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\AjaxDataCollector' => $vendorDir . '/symfony/http-kernel/DataCollector/AjaxDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\ConfigDataCollector' => $vendorDir . '/symfony/http-kernel/DataCollector/ConfigDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector' => $vendorDir . '/symfony/http-kernel/DataCollector/DataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface' => $vendorDir . '/symfony/http-kernel/DataCollector/DataCollectorInterface.php', @@ -1380,22 +1473,16 @@ 'Symfony\\Component\\HttpKernel\\DataCollector\\RouterDataCollector' => $vendorDir . '/symfony/http-kernel/DataCollector/RouterDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\TimeDataCollector' => $vendorDir . '/symfony/http-kernel/DataCollector/TimeDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\Util\\ValueExporter' => $vendorDir . '/symfony/http-kernel/DataCollector/Util/ValueExporter.php', - 'Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler' => $vendorDir . '/symfony/http-kernel/Debug/ErrorHandler.php', - 'Symfony\\Component\\HttpKernel\\Debug\\ExceptionHandler' => $vendorDir . '/symfony/http-kernel/Debug/ExceptionHandler.php', 'Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher' => $vendorDir . '/symfony/http-kernel/Debug/TraceableEventDispatcher.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\AddClassesToCachePass' => $vendorDir . '/symfony/http-kernel/DependencyInjection/AddClassesToCachePass.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ConfigurableExtension' => $vendorDir . '/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php', - 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel' => $vendorDir . '/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\Extension' => $vendorDir . '/symfony/http-kernel/DependencyInjection/Extension.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\FragmentRendererPass' => $vendorDir . '/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\LazyLoadingFragmentHandler' => $vendorDir . '/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\MergeExtensionConfigurationPass' => $vendorDir . '/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php', - 'Symfony\\Component\\HttpKernel\\DependencyInjection\\RegisterListenersPass' => $vendorDir . '/symfony/http-kernel/DependencyInjection/RegisterListenersPass.php', 'Symfony\\Component\\HttpKernel\\EventListener\\AddRequestFormatsListener' => $vendorDir . '/symfony/http-kernel/EventListener/AddRequestFormatsListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener' => $vendorDir . '/symfony/http-kernel/EventListener/DebugHandlersListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DumpListener' => $vendorDir . '/symfony/http-kernel/EventListener/DumpListener.php', - 'Symfony\\Component\\HttpKernel\\EventListener\\ErrorsLoggerListener' => $vendorDir . '/symfony/http-kernel/EventListener/ErrorsLoggerListener.php', - 'Symfony\\Component\\HttpKernel\\EventListener\\EsiListener' => $vendorDir . '/symfony/http-kernel/EventListener/EsiListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener' => $vendorDir . '/symfony/http-kernel/EventListener/ExceptionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\FragmentListener' => $vendorDir . '/symfony/http-kernel/EventListener/FragmentListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener' => $vendorDir . '/symfony/http-kernel/EventListener/LocaleListener.php', @@ -1443,15 +1530,12 @@ 'Symfony\\Component\\HttpKernel\\Fragment\\RoutableFragmentRenderer' => $vendorDir . '/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php', 'Symfony\\Component\\HttpKernel\\Fragment\\SsiFragmentRenderer' => $vendorDir . '/symfony/http-kernel/Fragment/SsiFragmentRenderer.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\Esi' => $vendorDir . '/symfony/http-kernel/HttpCache/Esi.php', - 'Symfony\\Component\\HttpKernel\\HttpCache\\EsiResponseCacheStrategy' => $vendorDir . '/symfony/http-kernel/HttpCache/EsiResponseCacheStrategy.php', - 'Symfony\\Component\\HttpKernel\\HttpCache\\EsiResponseCacheStrategyInterface' => $vendorDir . '/symfony/http-kernel/HttpCache/EsiResponseCacheStrategyInterface.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache' => $vendorDir . '/symfony/http-kernel/HttpCache/HttpCache.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\ResponseCacheStrategy' => $vendorDir . '/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\ResponseCacheStrategyInterface' => $vendorDir . '/symfony/http-kernel/HttpCache/ResponseCacheStrategyInterface.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\Ssi' => $vendorDir . '/symfony/http-kernel/HttpCache/Ssi.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\Store' => $vendorDir . '/symfony/http-kernel/HttpCache/Store.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface' => $vendorDir . '/symfony/http-kernel/HttpCache/StoreInterface.php', - 'Symfony\\Component\\HttpKernel\\HttpCache\\SubRequestHandler' => $vendorDir . '/symfony/http-kernel/HttpCache/SubRequestHandler.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\SurrogateInterface' => $vendorDir . '/symfony/http-kernel/HttpCache/SurrogateInterface.php', 'Symfony\\Component\\HttpKernel\\HttpKernel' => $vendorDir . '/symfony/http-kernel/HttpKernel.php', 'Symfony\\Component\\HttpKernel\\HttpKernelInterface' => $vendorDir . '/symfony/http-kernel/HttpKernelInterface.php', @@ -1459,20 +1543,10 @@ 'Symfony\\Component\\HttpKernel\\KernelEvents' => $vendorDir . '/symfony/http-kernel/KernelEvents.php', 'Symfony\\Component\\HttpKernel\\KernelInterface' => $vendorDir . '/symfony/http-kernel/KernelInterface.php', 'Symfony\\Component\\HttpKernel\\Log\\DebugLoggerInterface' => $vendorDir . '/symfony/http-kernel/Log/DebugLoggerInterface.php', - 'Symfony\\Component\\HttpKernel\\Log\\LoggerInterface' => $vendorDir . '/symfony/http-kernel/Log/LoggerInterface.php', - 'Symfony\\Component\\HttpKernel\\Log\\NullLogger' => $vendorDir . '/symfony/http-kernel/Log/NullLogger.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\BaseMemcacheProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/BaseMemcacheProfilerStorage.php', 'Symfony\\Component\\HttpKernel\\Profiler\\FileProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/FileProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MemcacheProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/MemcacheProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MemcachedProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/MemcachedProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MongoDbProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/MongoDbProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MysqlProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/MysqlProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\PdoProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/PdoProfilerStorage.php', 'Symfony\\Component\\HttpKernel\\Profiler\\Profile' => $vendorDir . '/symfony/http-kernel/Profiler/Profile.php', 'Symfony\\Component\\HttpKernel\\Profiler\\Profiler' => $vendorDir . '/symfony/http-kernel/Profiler/Profiler.php', 'Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface' => $vendorDir . '/symfony/http-kernel/Profiler/ProfilerStorageInterface.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\RedisProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/RedisProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\SqliteProfilerStorage' => $vendorDir . '/symfony/http-kernel/Profiler/SqliteProfilerStorage.php', 'Symfony\\Component\\HttpKernel\\TerminableInterface' => $vendorDir . '/symfony/http-kernel/TerminableInterface.php', 'Symfony\\Component\\HttpKernel\\UriSigner' => $vendorDir . '/symfony/http-kernel/UriSigner.php', 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/process/Exception/ExceptionInterface.php', @@ -1509,12 +1583,12 @@ 'Symfony\\Component\\Routing\\Loader\\AnnotationDirectoryLoader' => $vendorDir . '/symfony/routing/Loader/AnnotationDirectoryLoader.php', 'Symfony\\Component\\Routing\\Loader\\AnnotationFileLoader' => $vendorDir . '/symfony/routing/Loader/AnnotationFileLoader.php', 'Symfony\\Component\\Routing\\Loader\\ClosureLoader' => $vendorDir . '/symfony/routing/Loader/ClosureLoader.php', + 'Symfony\\Component\\Routing\\Loader\\DependencyInjection\\ServiceRouterLoader' => $vendorDir . '/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php', + 'Symfony\\Component\\Routing\\Loader\\DirectoryLoader' => $vendorDir . '/symfony/routing/Loader/DirectoryLoader.php', + 'Symfony\\Component\\Routing\\Loader\\ObjectRouteLoader' => $vendorDir . '/symfony/routing/Loader/ObjectRouteLoader.php', 'Symfony\\Component\\Routing\\Loader\\PhpFileLoader' => $vendorDir . '/symfony/routing/Loader/PhpFileLoader.php', - 'Symfony\\Component\\Routing\\Loader\\RecursiveCallbackFilterIterator' => $vendorDir . '/symfony/routing/Loader/AnnotationDirectoryLoader.php', 'Symfony\\Component\\Routing\\Loader\\XmlFileLoader' => $vendorDir . '/symfony/routing/Loader/XmlFileLoader.php', 'Symfony\\Component\\Routing\\Loader\\YamlFileLoader' => $vendorDir . '/symfony/routing/Loader/YamlFileLoader.php', - 'Symfony\\Component\\Routing\\Matcher\\ApacheUrlMatcher' => $vendorDir . '/symfony/routing/Matcher/ApacheUrlMatcher.php', - 'Symfony\\Component\\Routing\\Matcher\\Dumper\\ApacheMatcherDumper' => $vendorDir . '/symfony/routing/Matcher/Dumper/ApacheMatcherDumper.php', 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperCollection' => $vendorDir . '/symfony/routing/Matcher/Dumper/DumperCollection.php', 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperPrefixCollection' => $vendorDir . '/symfony/routing/Matcher/Dumper/DumperPrefixCollection.php', 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperRoute' => $vendorDir . '/symfony/routing/Matcher/Dumper/DumperRoute.php', @@ -1531,14 +1605,15 @@ 'Symfony\\Component\\Routing\\RequestContextAwareInterface' => $vendorDir . '/symfony/routing/RequestContextAwareInterface.php', 'Symfony\\Component\\Routing\\Route' => $vendorDir . '/symfony/routing/Route.php', 'Symfony\\Component\\Routing\\RouteCollection' => $vendorDir . '/symfony/routing/RouteCollection.php', + 'Symfony\\Component\\Routing\\RouteCollectionBuilder' => $vendorDir . '/symfony/routing/RouteCollectionBuilder.php', 'Symfony\\Component\\Routing\\RouteCompiler' => $vendorDir . '/symfony/routing/RouteCompiler.php', 'Symfony\\Component\\Routing\\RouteCompilerInterface' => $vendorDir . '/symfony/routing/RouteCompilerInterface.php', 'Symfony\\Component\\Routing\\Router' => $vendorDir . '/symfony/routing/Router.php', 'Symfony\\Component\\Routing\\RouterInterface' => $vendorDir . '/symfony/routing/RouterInterface.php', 'Symfony\\Component\\Translation\\Catalogue\\AbstractOperation' => $vendorDir . '/symfony/translation/Catalogue/AbstractOperation.php', - 'Symfony\\Component\\Translation\\Catalogue\\DiffOperation' => $vendorDir . '/symfony/translation/Catalogue/DiffOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\MergeOperation' => $vendorDir . '/symfony/translation/Catalogue/MergeOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\OperationInterface' => $vendorDir . '/symfony/translation/Catalogue/OperationInterface.php', + 'Symfony\\Component\\Translation\\Catalogue\\TargetOperation' => $vendorDir . '/symfony/translation/Catalogue/TargetOperation.php', 'Symfony\\Component\\Translation\\DataCollectorTranslator' => $vendorDir . '/symfony/translation/DataCollectorTranslator.php', 'Symfony\\Component\\Translation\\DataCollector\\TranslationDataCollector' => $vendorDir . '/symfony/translation/DataCollector/TranslationDataCollector.php', 'Symfony\\Component\\Translation\\Dumper\\CsvFileDumper' => $vendorDir . '/symfony/translation/Dumper/CsvFileDumper.php', @@ -1563,6 +1638,7 @@ 'Symfony\\Component\\Translation\\Interval' => $vendorDir . '/symfony/translation/Interval.php', 'Symfony\\Component\\Translation\\Loader\\ArrayLoader' => $vendorDir . '/symfony/translation/Loader/ArrayLoader.php', 'Symfony\\Component\\Translation\\Loader\\CsvFileLoader' => $vendorDir . '/symfony/translation/Loader/CsvFileLoader.php', + 'Symfony\\Component\\Translation\\Loader\\FileLoader' => $vendorDir . '/symfony/translation/Loader/FileLoader.php', 'Symfony\\Component\\Translation\\Loader\\IcuDatFileLoader' => $vendorDir . '/symfony/translation/Loader/IcuDatFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\IcuResFileLoader' => $vendorDir . '/symfony/translation/Loader/IcuResFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\IniFileLoader' => $vendorDir . '/symfony/translation/Loader/IniFileLoader.php', @@ -1583,20 +1659,26 @@ 'Symfony\\Component\\Translation\\Translator' => $vendorDir . '/symfony/translation/Translator.php', 'Symfony\\Component\\Translation\\TranslatorBagInterface' => $vendorDir . '/symfony/translation/TranslatorBagInterface.php', 'Symfony\\Component\\Translation\\TranslatorInterface' => $vendorDir . '/symfony/translation/TranslatorInterface.php', + 'Symfony\\Component\\Translation\\Util\\ArrayConverter' => $vendorDir . '/symfony/translation/Util/ArrayConverter.php', 'Symfony\\Component\\Translation\\Writer\\TranslationWriter' => $vendorDir . '/symfony/translation/Writer/TranslationWriter.php', 'Symfony\\Component\\VarDumper\\Caster\\AmqpCaster' => $vendorDir . '/symfony/var-dumper/Caster/AmqpCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\Caster' => $vendorDir . '/symfony/var-dumper/Caster/Caster.php', 'Symfony\\Component\\VarDumper\\Caster\\ConstStub' => $vendorDir . '/symfony/var-dumper/Caster/ConstStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\CutArrayStub' => $vendorDir . '/symfony/var-dumper/Caster/CutArrayStub.php', 'Symfony\\Component\\VarDumper\\Caster\\CutStub' => $vendorDir . '/symfony/var-dumper/Caster/CutStub.php', 'Symfony\\Component\\VarDumper\\Caster\\DOMCaster' => $vendorDir . '/symfony/var-dumper/Caster/DOMCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster' => $vendorDir . '/symfony/var-dumper/Caster/DoctrineCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\EnumStub' => $vendorDir . '/symfony/var-dumper/Caster/EnumStub.php', 'Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster' => $vendorDir . '/symfony/var-dumper/Caster/ExceptionCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\FrameStub' => $vendorDir . '/symfony/var-dumper/Caster/FrameStub.php', 'Symfony\\Component\\VarDumper\\Caster\\MongoCaster' => $vendorDir . '/symfony/var-dumper/Caster/MongoCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\PdoCaster' => $vendorDir . '/symfony/var-dumper/Caster/PdoCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster' => $vendorDir . '/symfony/var-dumper/Caster/PgSqlCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster' => $vendorDir . '/symfony/var-dumper/Caster/ReflectionCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ResourceCaster' => $vendorDir . '/symfony/var-dumper/Caster/ResourceCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\SplCaster' => $vendorDir . '/symfony/var-dumper/Caster/SplCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\StubCaster' => $vendorDir . '/symfony/var-dumper/Caster/StubCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\TraceStub' => $vendorDir . '/symfony/var-dumper/Caster/TraceStub.php', 'Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster' => $vendorDir . '/symfony/var-dumper/Caster/XmlResourceCaster.php', 'Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => $vendorDir . '/symfony/var-dumper/Cloner/AbstractCloner.php', 'Symfony\\Component\\VarDumper\\Cloner\\ClonerInterface' => $vendorDir . '/symfony/var-dumper/Cloner/ClonerInterface.php', @@ -1610,20 +1692,10 @@ 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' => $vendorDir . '/symfony/var-dumper/Dumper/DataDumperInterface.php', 'Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper' => $vendorDir . '/symfony/var-dumper/Dumper/HtmlDumper.php', 'Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => $vendorDir . '/symfony/var-dumper/Exception/ThrowingCasterException.php', - 'Symfony\\Component\\VarDumper\\Test\\VarDumperTestCase' => $vendorDir . '/symfony/var-dumper/Test/VarDumperTestCase.php', 'Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait' => $vendorDir . '/symfony/var-dumper/Test/VarDumperTestTrait.php', 'Symfony\\Component\\VarDumper\\VarDumper' => $vendorDir . '/symfony/var-dumper/VarDumper.php', 'Symfony\\Polyfill\\Ctype\\Ctype' => $vendorDir . '/symfony/polyfill-ctype/Ctype.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php', - 'Symfony\\Polyfill\\Php56\\Php56' => $vendorDir . '/symfony/polyfill-php56/Php56.php', - 'Symfony\\Polyfill\\Util\\Binary' => $vendorDir . '/symfony/polyfill-util/Binary.php', - 'Symfony\\Polyfill\\Util\\BinaryNoFuncOverload' => $vendorDir . '/symfony/polyfill-util/BinaryNoFuncOverload.php', - 'Symfony\\Polyfill\\Util\\BinaryOnFuncOverload' => $vendorDir . '/symfony/polyfill-util/BinaryOnFuncOverload.php', - 'Symfony\\Polyfill\\Util\\TestListener' => $vendorDir . '/symfony/polyfill-util/TestListener.php', - 'Symfony\\Polyfill\\Util\\TestListenerForV5' => $vendorDir . '/symfony/polyfill-util/TestListenerForV5.php', - 'Symfony\\Polyfill\\Util\\TestListenerForV6' => $vendorDir . '/symfony/polyfill-util/TestListenerForV6.php', - 'Symfony\\Polyfill\\Util\\TestListenerForV7' => $vendorDir . '/symfony/polyfill-util/TestListenerForV7.php', - 'Symfony\\Polyfill\\Util\\TestListenerTrait' => $vendorDir . '/symfony/polyfill-util/TestListenerTrait.php', 'UpdateHelper\\ComposerPlugin' => $vendorDir . '/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php', 'UpdateHelper\\NotUpdateInterfaceInstanceException' => $vendorDir . '/kylekatarnls/update-helper/src/UpdateHelper/NotUpdateInterfaceInstanceException.php', 'UpdateHelper\\UpdateHelper' => $vendorDir . '/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php', diff --git a/application/vendor/composer/autoload_files.php b/application/vendor/composer/autoload_files.php index e382886..142dc6f 100644 --- a/application/vendor/composer/autoload_files.php +++ b/application/vendor/composer/autoload_files.php @@ -10,8 +10,6 @@ '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', - 'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php', - '65fec9ebcfbb3cbb4fd0d519687aea01' => $vendorDir . '/danielstjules/stringy/src/Create.php', '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', 'e7223560d890eab89cda23685e711e2c' => $vendorDir . '/psy/psysh/src/Psy/functions.php', 'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php', diff --git a/application/vendor/composer/autoload_namespaces.php b/application/vendor/composer/autoload_namespaces.php index de88cac..61809d0 100644 --- a/application/vendor/composer/autoload_namespaces.php +++ b/application/vendor/composer/autoload_namespaces.php @@ -8,5 +8,4 @@ return array( 'UpdateHelper\\' => array($vendorDir . '/kylekatarnls/update-helper/src'), 'JakubOnderka\\PhpConsoleHighlighter' => array($vendorDir . '/jakub-onderka/php-console-highlighter/src'), - 'Dotenv' => array($vendorDir . '/vlucas/phpdotenv/src'), ); diff --git a/application/vendor/composer/autoload_psr4.php b/application/vendor/composer/autoload_psr4.php index b546906..0d0670d 100644 --- a/application/vendor/composer/autoload_psr4.php +++ b/application/vendor/composer/autoload_psr4.php @@ -7,8 +7,6 @@ return array( 'XdgBaseDir\\' => array($vendorDir . '/dnoegel/php-xdg-base-dir/src'), - 'Symfony\\Polyfill\\Util\\' => array($vendorDir . '/symfony/polyfill-util'), - 'Symfony\\Polyfill\\Php56\\' => array($vendorDir . '/symfony/polyfill-php56'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), @@ -24,14 +22,16 @@ 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'SuperClosure\\' => array($vendorDir . '/jeremeamia/superclosure/src'), - 'Stringy\\' => array($vendorDir . '/danielstjules/stringy/src'), 'Psy\\' => array($vendorDir . '/psy/psysh/src/Psy'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), + 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), 'JakubOnderka\\PhpConsoleColor\\' => array($vendorDir . '/jakub-onderka/php-console-color/src'), 'Illuminate\\' => array($vendorDir . '/laravel/framework/src/Illuminate'), + 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), + 'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'), 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'), 'Cron\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'), 'Collective\\Html\\' => array($vendorDir . '/laravelcollective/html/src'), diff --git a/application/vendor/composer/autoload_real.php b/application/vendor/composer/autoload_real.php index 4b0dd32..04c870e 100644 --- a/application/vendor/composer/autoload_real.php +++ b/application/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit43265f891b9f29a025a40de9ffd797c4 +class ComposerAutoloaderInitf78e08ce03e899835ef37b4c3f44d248 { private static $loader; @@ -13,21 +13,24 @@ public static function loadClassLoader($class) } } + /** + * @return \Composer\Autoload\ClassLoader + */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit43265f891b9f29a025a40de9ffd797c4', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitf78e08ce03e899835ef37b4c3f44d248', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit43265f891b9f29a025a40de9ffd797c4', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitf78e08ce03e899835ef37b4c3f44d248', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +51,19 @@ public static function getLoader() $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire43265f891b9f29a025a40de9ffd797c4($fileIdentifier, $file); + composerRequiref78e08ce03e899835ef37b4c3f44d248($fileIdentifier, $file); } return $loader; } } -function composerRequire43265f891b9f29a025a40de9ffd797c4($fileIdentifier, $file) +function composerRequiref78e08ce03e899835ef37b4c3f44d248($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/application/vendor/composer/autoload_static.php b/application/vendor/composer/autoload_static.php index 0b4aad4..5d4a9d7 100644 --- a/application/vendor/composer/autoload_static.php +++ b/application/vendor/composer/autoload_static.php @@ -4,15 +4,13 @@ namespace Composer\Autoload; -class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 +class ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248 { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php', - 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php', - '65fec9ebcfbb3cbb4fd0d519687aea01' => __DIR__ . '/..' . '/danielstjules/stringy/src/Create.php', '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', 'e7223560d890eab89cda23685e711e2c' => __DIR__ . '/..' . '/psy/psysh/src/Psy/functions.php', 'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php', @@ -27,8 +25,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 ), 'S' => array ( - 'Symfony\\Polyfill\\Util\\' => 22, - 'Symfony\\Polyfill\\Php56\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Polyfill\\Ctype\\' => 23, 'Symfony\\Component\\VarDumper\\' => 28, @@ -44,7 +40,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\CssSelector\\' => 30, 'Symfony\\Component\\Console\\' => 26, 'SuperClosure\\' => 13, - 'Stringy\\' => 8, ), 'P' => array ( @@ -58,6 +53,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 ), 'L' => array ( + 'League\\MimeTypeDetection\\' => 25, 'League\\Flysystem\\' => 17, ), 'J' => @@ -70,6 +66,8 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 ), 'D' => array ( + 'Dotenv\\' => 7, + 'Doctrine\\Inflector\\' => 19, 'Doctrine\\Common\\Inflector\\' => 26, ), 'C' => @@ -89,14 +87,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 array ( 0 => __DIR__ . '/..' . '/dnoegel/php-xdg-base-dir/src', ), - 'Symfony\\Polyfill\\Util\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-util', - ), - 'Symfony\\Polyfill\\Php56\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php56', - ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', @@ -157,10 +147,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 array ( 0 => __DIR__ . '/..' . '/jeremeamia/superclosure/src', ), - 'Stringy\\' => - array ( - 0 => __DIR__ . '/..' . '/danielstjules/stringy/src', - ), 'Psy\\' => array ( 0 => __DIR__ . '/..' . '/psy/psysh/src/Psy', @@ -177,6 +163,10 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 array ( 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', ), + 'League\\MimeTypeDetection\\' => + array ( + 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', + ), 'League\\Flysystem\\' => array ( 0 => __DIR__ . '/..' . '/league/flysystem/src', @@ -189,6 +179,14 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 array ( 0 => __DIR__ . '/..' . '/laravel/framework/src/Illuminate', ), + 'Dotenv\\' => + array ( + 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', + ), + 'Doctrine\\Inflector\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector', + ), 'Doctrine\\Common\\Inflector\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector', @@ -230,16 +228,10 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 0 => __DIR__ . '/..' . '/jakub-onderka/php-console-highlighter/src', ), ), - 'D' => - array ( - 'Dotenv' => - array ( - 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', - ), - ), ); public static $classMap = array ( + 'AddFieldsToServers' => __DIR__ . '/../..' . '/database/migrations/2018_12_23_184255_AddFieldsToServers.php', 'App\\Commands\\Command' => __DIR__ . '/../..' . '/app/Commands/Command.php', 'App\\Console\\Commands\\Inspire' => __DIR__ . '/../..' . '/app/Console/Commands/Inspire.php', 'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php', @@ -275,6 +267,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'App\\Http\\Middleware\\VerifyInstalled' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyInstalled.php', 'App\\Http\\Middleware\\VerifyNotInstalled' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyNotInstalled.php', 'App\\Http\\Middleware\\VerifyServers' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyServers.php', + 'App\\Http\\Middleware\\VerifyServersUpgraded' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyServersUpgraded.php', 'App\\Http\\Requests\\Request' => __DIR__ . '/../..' . '/app/Http/Requests/Request.php', 'App\\IpBan' => __DIR__ . '/../..' . '/app/IpBan.php', 'App\\IpBanRecord' => __DIR__ . '/../..' . '/app/IpBanRecord.php', @@ -288,14 +281,12 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'App\\PlayerNote' => __DIR__ . '/../..' . '/app/PlayerNote.php', 'App\\PlayerWarning' => __DIR__ . '/../..' . '/app/PlayerWarning.php', 'App\\Providers\\AppServiceProvider' => __DIR__ . '/../..' . '/app/Providers/AppServiceProvider.php', - 'App\\Providers\\BusServiceProvider' => __DIR__ . '/../..' . '/app/Providers/BusServiceProvider.php', 'App\\Providers\\ConfigServiceProvider' => __DIR__ . '/../..' . '/app/Providers/ConfigServiceProvider.php', 'App\\Providers\\EventServiceProvider' => __DIR__ . '/../..' . '/app/Providers/EventServiceProvider.php', 'App\\Providers\\HelperServiceProvider' => __DIR__ . '/../..' . '/app/Providers/HelperServiceProvider.php', 'App\\Providers\\RouteServiceProvider' => __DIR__ . '/../..' . '/app/Providers/RouteServiceProvider.php', 'App\\RecordBaseModel' => __DIR__ . '/../..' . '/app/RecordBaseModel.php', 'App\\Server' => __DIR__ . '/../..' . '/app/Server.php', - 'App\\Services\\Registrar' => __DIR__ . '/../..' . '/app/Services/Registrar.php', 'App\\User' => __DIR__ . '/../..' . '/app/User.php', 'Carbon\\Carbon' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Carbon.php', 'Carbon\\CarbonInterval' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonInterval.php', @@ -319,6 +310,8 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'ClassPreloader\\Parser\\FileVisitor' => __DIR__ . '/..' . '/classpreloader/classpreloader/src/Parser/FileVisitor.php', 'ClassPreloader\\Parser\\NodeTraverser' => __DIR__ . '/..' . '/classpreloader/classpreloader/src/Parser/NodeTraverser.php', 'ClassPreloader\\Parser\\StrictTypesVisitor' => __DIR__ . '/..' . '/classpreloader/classpreloader/src/Parser/StrictTypesVisitor.php', + 'Collective\\Html\\Componentable' => __DIR__ . '/..' . '/laravelcollective/html/src/Componentable.php', + 'Collective\\Html\\Eloquent\\FormAccessible' => __DIR__ . '/..' . '/laravelcollective/html/src/Eloquent/FormAccessible.php', 'Collective\\Html\\FormBuilder' => __DIR__ . '/..' . '/laravelcollective/html/src/FormBuilder.php', 'Collective\\Html\\FormFacade' => __DIR__ . '/..' . '/laravelcollective/html/src/FormFacade.php', 'Collective\\Html\\HtmlBuilder' => __DIR__ . '/..' . '/laravelcollective/html/src/HtmlBuilder.php', @@ -339,27 +332,87 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Cron\\YearField' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/YearField.php', 'DatabaseSeeder' => __DIR__ . '/../..' . '/database/seeds/DatabaseSeeder.php', 'Doctrine\\Common\\Inflector\\Inflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php', - 'Dotenv' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Dotenv.php', + 'Doctrine\\Inflector\\CachedWordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php', + 'Doctrine\\Inflector\\GenericLanguageInflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php', + 'Doctrine\\Inflector\\Inflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php', + 'Doctrine\\Inflector\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php', + 'Doctrine\\Inflector\\Language' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Language.php', + 'Doctrine\\Inflector\\LanguageInflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/LanguageInflectorFactory.php', + 'Doctrine\\Inflector\\NoopWordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/NoopWordInflector.php', + 'Doctrine\\Inflector\\Rules\\English\\Inflectible' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\English\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\English\\Rules' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Rules.php', + 'Doctrine\\Inflector\\Rules\\English\\Uninflected' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\French\\Inflectible' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\French\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\French\\Rules' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Rules.php', + 'Doctrine\\Inflector\\Rules\\French\\Uninflected' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\Inflectible' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\Rules' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Rules.php', + 'Doctrine\\Inflector\\Rules\\NorwegianBokmal\\Uninflected' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Pattern' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Pattern.php', + 'Doctrine\\Inflector\\Rules\\Patterns' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\Inflectible' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\Rules' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Rules.php', + 'Doctrine\\Inflector\\Rules\\Portuguese\\Uninflected' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Ruleset' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Ruleset.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\Inflectible' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\Rules' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Rules.php', + 'Doctrine\\Inflector\\Rules\\Spanish\\Uninflected' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Substitution' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitution.php', + 'Doctrine\\Inflector\\Rules\\Substitutions' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php', + 'Doctrine\\Inflector\\Rules\\Transformation' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php', + 'Doctrine\\Inflector\\Rules\\Transformations' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\Inflectible' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\InflectorFactory' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/InflectorFactory.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\Rules' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Rules.php', + 'Doctrine\\Inflector\\Rules\\Turkish\\Uninflected' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php', + 'Doctrine\\Inflector\\Rules\\Word' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/Rules/Word.php', + 'Doctrine\\Inflector\\RulesetInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php', + 'Doctrine\\Inflector\\WordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php', + 'Dotenv\\Dotenv' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Dotenv.php', + 'Dotenv\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Exception/ExceptionInterface.php', + 'Dotenv\\Exception\\InvalidCallbackException' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Exception/InvalidCallbackException.php', + 'Dotenv\\Exception\\InvalidFileException' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Exception/InvalidFileException.php', + 'Dotenv\\Exception\\InvalidPathException' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Exception/InvalidPathException.php', + 'Dotenv\\Exception\\ValidationException' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Exception/ValidationException.php', + 'Dotenv\\Loader' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Loader.php', + 'Dotenv\\Parser' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Parser.php', + 'Dotenv\\Validator' => __DIR__ . '/..' . '/vlucas/phpdotenv/src/Validator.php', 'IlluminateQueueClosure' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/IlluminateQueueClosure.php', + 'Illuminate\\Auth\\Access\\AuthorizationException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php', 'Illuminate\\Auth\\Access\\Gate' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Access/Gate.php', 'Illuminate\\Auth\\Access\\HandlesAuthorization' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php', 'Illuminate\\Auth\\Access\\Response' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Access/Response.php', - 'Illuminate\\Auth\\Access\\UnauthorizedException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Access/UnauthorizedException.php', 'Illuminate\\Auth\\AuthManager' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/AuthManager.php', 'Illuminate\\Auth\\AuthServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php', 'Illuminate\\Auth\\Authenticatable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Authenticatable.php', + 'Illuminate\\Auth\\AuthenticationException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/AuthenticationException.php', 'Illuminate\\Auth\\Console\\ClearResetsCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php', + 'Illuminate\\Auth\\Console\\MakeAuthCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Console/MakeAuthCommand.php', + 'Illuminate\\Auth\\CreatesUserProviders' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php', 'Illuminate\\Auth\\DatabaseUserProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php', 'Illuminate\\Auth\\EloquentUserProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php', - 'Illuminate\\Auth\\GeneratorServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/GeneratorServiceProvider.php', + 'Illuminate\\Auth\\Events\\Attempting' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Events/Attempting.php', + 'Illuminate\\Auth\\Events\\Failed' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Events/Failed.php', + 'Illuminate\\Auth\\Events\\Lockout' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Events/Lockout.php', + 'Illuminate\\Auth\\Events\\Login' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Events/Login.php', + 'Illuminate\\Auth\\Events\\Logout' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Events/Logout.php', 'Illuminate\\Auth\\GenericUser' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/GenericUser.php', - 'Illuminate\\Auth\\Guard' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Guard.php', + 'Illuminate\\Auth\\GuardHelpers' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/GuardHelpers.php', 'Illuminate\\Auth\\Middleware\\AuthenticateWithBasicAuth' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php', 'Illuminate\\Auth\\Passwords\\CanResetPassword' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Passwords/CanResetPassword.php', 'Illuminate\\Auth\\Passwords\\DatabaseTokenRepository' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php', 'Illuminate\\Auth\\Passwords\\PasswordBroker' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php', + 'Illuminate\\Auth\\Passwords\\PasswordBrokerManager' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php', 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php', 'Illuminate\\Auth\\Passwords\\TokenRepositoryInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php', + 'Illuminate\\Auth\\RequestGuard' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/RequestGuard.php', + 'Illuminate\\Auth\\SessionGuard' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/SessionGuard.php', + 'Illuminate\\Auth\\TokenGuard' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Auth/TokenGuard.php', 'Illuminate\\Broadcasting\\BroadcastEvent' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php', 'Illuminate\\Broadcasting\\BroadcastManager' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php', 'Illuminate\\Broadcasting\\BroadcastServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Broadcasting/BroadcastServiceProvider.php', @@ -368,7 +421,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Broadcasting\\Broadcasters\\RedisBroadcaster' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/RedisBroadcaster.php', 'Illuminate\\Bus\\BusServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php', 'Illuminate\\Bus\\Dispatcher' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Bus/Dispatcher.php', - 'Illuminate\\Bus\\MarshalException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Bus/MarshalException.php', 'Illuminate\\Bus\\Queueable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Bus/Queueable.php', 'Illuminate\\Cache\\ApcStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/ApcStore.php', 'Illuminate\\Cache\\ApcWrapper' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/ApcWrapper.php', @@ -378,6 +430,10 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Cache\\Console\\CacheTableCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php', 'Illuminate\\Cache\\Console\\ClearCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php', 'Illuminate\\Cache\\DatabaseStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/DatabaseStore.php', + 'Illuminate\\Cache\\Events\\CacheHit' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php', + 'Illuminate\\Cache\\Events\\CacheMissed' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php', + 'Illuminate\\Cache\\Events\\KeyForgotten' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Events/KeyForgotten.php', + 'Illuminate\\Cache\\Events\\KeyWritten' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Events/KeyWritten.php', 'Illuminate\\Cache\\FileStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/FileStore.php', 'Illuminate\\Cache\\MemcachedConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php', 'Illuminate\\Cache\\MemcachedStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/MemcachedStore.php', @@ -386,16 +442,16 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Cache\\RedisStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/RedisStore.php', 'Illuminate\\Cache\\RedisTaggedCache' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/RedisTaggedCache.php', 'Illuminate\\Cache\\Repository' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/Repository.php', + 'Illuminate\\Cache\\RetrievesMultipleKeys' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php', 'Illuminate\\Cache\\TagSet' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/TagSet.php', 'Illuminate\\Cache\\TaggableStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/TaggableStore.php', 'Illuminate\\Cache\\TaggedCache' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/TaggedCache.php', - 'Illuminate\\Cache\\WinCacheStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/WinCacheStore.php', - 'Illuminate\\Cache\\XCacheStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Cache/XCacheStore.php', 'Illuminate\\Config\\Repository' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Config/Repository.php', 'Illuminate\\Console\\AppNamespaceDetectorTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/AppNamespaceDetectorTrait.php', 'Illuminate\\Console\\Application' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Application.php', 'Illuminate\\Console\\Command' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Command.php', 'Illuminate\\Console\\ConfirmableTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php', + 'Illuminate\\Console\\Events\\ArtisanStarting' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Events/ArtisanStarting.php', 'Illuminate\\Console\\GeneratorCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/GeneratorCommand.php', 'Illuminate\\Console\\OutputStyle' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/OutputStyle.php', 'Illuminate\\Console\\Parser' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Parser.php', @@ -404,23 +460,25 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Console\\Scheduling\\Event' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Scheduling/Event.php', 'Illuminate\\Console\\Scheduling\\Schedule' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php', 'Illuminate\\Console\\Scheduling\\ScheduleRunCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php', - 'Illuminate\\Container\\BindingResolutionException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Container/BindingResolutionException.php', 'Illuminate\\Container\\Container' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Container/Container.php', 'Illuminate\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Container/ContextualBindingBuilder.php', 'Illuminate\\Contracts\\Auth\\Access\\Authorizable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/Access/Authorizable.php', 'Illuminate\\Contracts\\Auth\\Access\\Gate' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php', 'Illuminate\\Contracts\\Auth\\Authenticatable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/Authenticatable.php', 'Illuminate\\Contracts\\Auth\\CanResetPassword' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/CanResetPassword.php', + 'Illuminate\\Contracts\\Auth\\Factory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/Factory.php', 'Illuminate\\Contracts\\Auth\\Guard' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/Guard.php', 'Illuminate\\Contracts\\Auth\\PasswordBroker' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/PasswordBroker.php', + 'Illuminate\\Contracts\\Auth\\PasswordBrokerFactory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/PasswordBrokerFactory.php', 'Illuminate\\Contracts\\Auth\\Registrar' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/Registrar.php', + 'Illuminate\\Contracts\\Auth\\StatefulGuard' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/StatefulGuard.php', + 'Illuminate\\Contracts\\Auth\\SupportsBasicAuth' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/SupportsBasicAuth.php', 'Illuminate\\Contracts\\Auth\\UserProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Auth/UserProvider.php', 'Illuminate\\Contracts\\Broadcasting\\Broadcaster' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/Broadcaster.php', 'Illuminate\\Contracts\\Broadcasting\\Factory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/Factory.php', 'Illuminate\\Contracts\\Broadcasting\\ShouldBroadcast' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/ShouldBroadcast.php', 'Illuminate\\Contracts\\Broadcasting\\ShouldBroadcastNow' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Broadcasting/ShouldBroadcastNow.php', 'Illuminate\\Contracts\\Bus\\Dispatcher' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Bus/Dispatcher.php', - 'Illuminate\\Contracts\\Bus\\HandlerResolver' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Bus/HandlerResolver.php', 'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Bus/QueueingDispatcher.php', 'Illuminate\\Contracts\\Bus\\SelfHandling' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Bus/SelfHandling.php', 'Illuminate\\Contracts\\Cache\\Factory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Cache/Factory.php', @@ -461,14 +519,12 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Contracts\\Queue\\Job' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/Job.php', 'Illuminate\\Contracts\\Queue\\Monitor' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/Monitor.php', 'Illuminate\\Contracts\\Queue\\Queue' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/Queue.php', + 'Illuminate\\Contracts\\Queue\\QueueableCollection' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/QueueableCollection.php', 'Illuminate\\Contracts\\Queue\\QueueableEntity' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/QueueableEntity.php', - 'Illuminate\\Contracts\\Queue\\ShouldBeQueued' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/ShouldBeQueued.php', 'Illuminate\\Contracts\\Queue\\ShouldQueue' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Queue/ShouldQueue.php', 'Illuminate\\Contracts\\Redis\\Database' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Redis/Database.php', - 'Illuminate\\Contracts\\Routing\\Middleware' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Routing/Middleware.php', 'Illuminate\\Contracts\\Routing\\Registrar' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Routing/Registrar.php', 'Illuminate\\Contracts\\Routing\\ResponseFactory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Routing/ResponseFactory.php', - 'Illuminate\\Contracts\\Routing\\TerminableMiddleware' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Routing/TerminableMiddleware.php', 'Illuminate\\Contracts\\Routing\\UrlGenerator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Routing/UrlGenerator.php', 'Illuminate\\Contracts\\Routing\\UrlRoutable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Routing/UrlRoutable.php', 'Illuminate\\Contracts\\Support\\Arrayable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Support/Arrayable.php', @@ -535,9 +591,15 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Database\\Eloquent\\Relations\\MorphToMany' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php', 'Illuminate\\Database\\Eloquent\\Relations\\Pivot' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php', 'Illuminate\\Database\\Eloquent\\Relations\\Relation' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php', + 'Illuminate\\Database\\Eloquent\\Scope' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php', 'Illuminate\\Database\\Eloquent\\ScopeInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/ScopeInterface.php', 'Illuminate\\Database\\Eloquent\\SoftDeletes' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletes.php', 'Illuminate\\Database\\Eloquent\\SoftDeletingScope' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php', + 'Illuminate\\Database\\Events\\ConnectionEvent' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php', + 'Illuminate\\Database\\Events\\QueryExecuted' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php', + 'Illuminate\\Database\\Events\\TransactionBeginning' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php', + 'Illuminate\\Database\\Events\\TransactionCommitted' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Events/TransactionCommitted.php', + 'Illuminate\\Database\\Events\\TransactionRolledBack' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Events/TransactionRolledBack.php', 'Illuminate\\Database\\Grammar' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Grammar.php', 'Illuminate\\Database\\MigrationServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/MigrationServiceProvider.php', 'Illuminate\\Database\\Migrations\\DatabaseMigrationRepository' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php', @@ -556,6 +618,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Database\\Query\\Grammars\\SQLiteGrammar' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php', 'Illuminate\\Database\\Query\\Grammars\\SqlServerGrammar' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php', 'Illuminate\\Database\\Query\\JoinClause' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/JoinClause.php', + 'Illuminate\\Database\\Query\\JsonExpression' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/JsonExpression.php', 'Illuminate\\Database\\Query\\Processors\\MySqlProcessor' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/Processors/MySqlProcessor.php', 'Illuminate\\Database\\Query\\Processors\\PostgresProcessor' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php', 'Illuminate\\Database\\Query\\Processors\\Processor' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php', @@ -590,12 +653,14 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Foundation\\Application' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Application.php', 'Illuminate\\Foundation\\Auth\\Access\\Authorizable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/Access/Authorizable.php', 'Illuminate\\Foundation\\Auth\\Access\\AuthorizesRequests' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php', + 'Illuminate\\Foundation\\Auth\\Access\\AuthorizesResources' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesResources.php', 'Illuminate\\Foundation\\Auth\\AuthenticatesAndRegistersUsers' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php', 'Illuminate\\Foundation\\Auth\\AuthenticatesUsers' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php', 'Illuminate\\Foundation\\Auth\\RedirectsUsers' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/RedirectsUsers.php', 'Illuminate\\Foundation\\Auth\\RegistersUsers' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php', 'Illuminate\\Foundation\\Auth\\ResetsPasswords' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php', 'Illuminate\\Foundation\\Auth\\ThrottlesLogins' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/ThrottlesLogins.php', + 'Illuminate\\Foundation\\Auth\\User' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Auth/User.php', 'Illuminate\\Foundation\\Bootstrap\\BootProviders' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php', 'Illuminate\\Foundation\\Bootstrap\\ConfigureLogging' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php', 'Illuminate\\Foundation\\Bootstrap\\DetectEnvironment' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php', @@ -604,13 +669,10 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php', 'Illuminate\\Foundation\\Bootstrap\\SetRequestForConsole' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php', - 'Illuminate\\Foundation\\Bus\\DispatchesCommands' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesCommands.php', 'Illuminate\\Foundation\\Bus\\DispatchesJobs' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php', - 'Illuminate\\Foundation\\Composer' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Composer.php', 'Illuminate\\Foundation\\ComposerScripts' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php', 'Illuminate\\Foundation\\Console\\AppNameCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php', 'Illuminate\\Foundation\\Console\\ClearCompiledCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php', - 'Illuminate\\Foundation\\Console\\CommandMakeCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/CommandMakeCommand.php', 'Illuminate\\Foundation\\Console\\ConfigCacheCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php', 'Illuminate\\Foundation\\Console\\ConfigClearCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/ConfigClearCommand.php', 'Illuminate\\Foundation\\Console\\ConsoleMakeCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/ConsoleMakeCommand.php', @@ -618,8 +680,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Foundation\\Console\\EnvironmentCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/EnvironmentCommand.php', 'Illuminate\\Foundation\\Console\\EventGenerateCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/EventGenerateCommand.php', 'Illuminate\\Foundation\\Console\\EventMakeCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/EventMakeCommand.php', - 'Illuminate\\Foundation\\Console\\HandlerCommandCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/HandlerCommandCommand.php', - 'Illuminate\\Foundation\\Console\\HandlerEventCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/HandlerEventCommand.php', 'Illuminate\\Foundation\\Console\\IlluminateCaster' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/IlluminateCaster.php', 'Illuminate\\Foundation\\Console\\JobMakeCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php', 'Illuminate\\Foundation\\Console\\Kernel' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php', @@ -644,6 +704,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Foundation\\Exceptions\\Handler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php', 'Illuminate\\Foundation\\Http\\FormRequest' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php', 'Illuminate\\Foundation\\Http\\Kernel' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php', + 'Illuminate\\Foundation\\Http\\Middleware\\Authorize' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/Authorize.php', 'Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php', 'Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php', 'Illuminate\\Foundation\\Http\\Middleware\\VerifyPostSize' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyPostSize.php', @@ -652,22 +713,38 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Foundation\\Providers\\ArtisanServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php', 'Illuminate\\Foundation\\Providers\\ComposerServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php', 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php', - 'Illuminate\\Foundation\\Providers\\FormRequestServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php', 'Illuminate\\Foundation\\Providers\\FoundationServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php', 'Illuminate\\Foundation\\Support\\Providers\\AuthServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Support/Providers/AuthServiceProvider.php', 'Illuminate\\Foundation\\Support\\Providers\\EventServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php', 'Illuminate\\Foundation\\Support\\Providers\\RouteServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php', - 'Illuminate\\Foundation\\Testing\\ApplicationTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/ApplicationTrait.php', - 'Illuminate\\Foundation\\Testing\\AssertionsTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/AssertionsTrait.php', - 'Illuminate\\Foundation\\Testing\\CrawlerTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/CrawlerTrait.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\ImpersonatesUsers' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithAuthentication' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithConsole' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithContainer' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithDatabase' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithPages' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\InteractsWithSession' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\MakesHttpRequests' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php', + 'Illuminate\\Foundation\\Testing\\Concerns\\MocksApplicationServices' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\FormFieldConstraint' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/FormFieldConstraint.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasElement' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasElement.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasInElement' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInElement.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasLink' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasLink.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasSource' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasSource.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasText' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasText.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\HasValue' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasValue.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\IsChecked' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsChecked.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\IsSelected' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsSelected.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\PageConstraint' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/PageConstraint.php', + 'Illuminate\\Foundation\\Testing\\Constraints\\ReversePageConstraint' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/ReversePageConstraint.php', 'Illuminate\\Foundation\\Testing\\DatabaseMigrations' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php', 'Illuminate\\Foundation\\Testing\\DatabaseTransactions' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php', 'Illuminate\\Foundation\\Testing\\HttpException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/HttpException.php', - 'Illuminate\\Foundation\\Testing\\InteractsWithPages' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/InteractsWithPages.php', 'Illuminate\\Foundation\\Testing\\TestCase' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php', 'Illuminate\\Foundation\\Testing\\WithoutEvents' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/WithoutEvents.php', 'Illuminate\\Foundation\\Testing\\WithoutMiddleware' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddleware.php', 'Illuminate\\Foundation\\Validation\\ValidatesRequests' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php', + 'Illuminate\\Foundation\\Validation\\ValidationException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/Validation/ValidationException.php', 'Illuminate\\Hashing\\BcryptHasher' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php', 'Illuminate\\Hashing\\HashServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php', 'Illuminate\\Http\\Exception\\HttpResponseException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Http/Exception/HttpResponseException.php', @@ -679,7 +756,9 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Http\\Request' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Http/Request.php', 'Illuminate\\Http\\Response' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Http/Response.php', 'Illuminate\\Http\\ResponseTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Http/ResponseTrait.php', + 'Illuminate\\Http\\UploadedFile' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Http/UploadedFile.php', 'Illuminate\\Log\\Writer' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Log/Writer.php', + 'Illuminate\\Mail\\Events\\MessageSending' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php', 'Illuminate\\Mail\\MailServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php', 'Illuminate\\Mail\\Mailer' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Mailer.php', 'Illuminate\\Mail\\Message' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Message.php', @@ -688,13 +767,17 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Mail\\Transport\\MailgunTransport' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php', 'Illuminate\\Mail\\Transport\\MandrillTransport' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Transport/MandrillTransport.php', 'Illuminate\\Mail\\Transport\\SesTransport' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Transport/SesTransport.php', + 'Illuminate\\Mail\\Transport\\SparkPostTransport' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Transport/SparkPostTransport.php', 'Illuminate\\Mail\\Transport\\Transport' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Mail/Transport/Transport.php', 'Illuminate\\Pagination\\AbstractPaginator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php', + 'Illuminate\\Pagination\\BootstrapFourNextPreviousButtonRendererTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/BootstrapFourNextPreviousButtonRendererTrait.php', + 'Illuminate\\Pagination\\BootstrapFourPresenter' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/BootstrapFourPresenter.php', 'Illuminate\\Pagination\\BootstrapThreeNextPreviousButtonRendererTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/BootstrapThreeNextPreviousButtonRendererTrait.php', 'Illuminate\\Pagination\\BootstrapThreePresenter' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/BootstrapThreePresenter.php', 'Illuminate\\Pagination\\LengthAwarePaginator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php', 'Illuminate\\Pagination\\PaginationServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php', 'Illuminate\\Pagination\\Paginator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/Paginator.php', + 'Illuminate\\Pagination\\SimpleBootstrapFourPresenter' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapFourPresenter.php', 'Illuminate\\Pagination\\SimpleBootstrapThreePresenter' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapThreePresenter.php', 'Illuminate\\Pagination\\UrlWindow' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/UrlWindow.php', 'Illuminate\\Pagination\\UrlWindowPresenterTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Pagination/UrlWindowPresenterTrait.php', @@ -707,7 +790,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Queue\\Connectors\\BeanstalkdConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php', 'Illuminate\\Queue\\Connectors\\ConnectorInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php', 'Illuminate\\Queue\\Connectors\\DatabaseConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/DatabaseConnector.php', - 'Illuminate\\Queue\\Connectors\\IronConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/IronConnector.php', 'Illuminate\\Queue\\Connectors\\NullConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/NullConnector.php', 'Illuminate\\Queue\\Connectors\\RedisConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/RedisConnector.php', 'Illuminate\\Queue\\Connectors\\SqsConnector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php', @@ -720,18 +802,20 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Queue\\Console\\ListenCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php', 'Illuminate\\Queue\\Console\\RestartCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Console/RestartCommand.php', 'Illuminate\\Queue\\Console\\RetryCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php', - 'Illuminate\\Queue\\Console\\SubscribeCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Console/SubscribeCommand.php', 'Illuminate\\Queue\\Console\\TableCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php', 'Illuminate\\Queue\\Console\\WorkCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php', 'Illuminate\\Queue\\DatabaseQueue' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php', + 'Illuminate\\Queue\\Events\\JobExceptionOccurred' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php', + 'Illuminate\\Queue\\Events\\JobFailed' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php', + 'Illuminate\\Queue\\Events\\JobProcessed' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php', + 'Illuminate\\Queue\\Events\\JobProcessing' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php', + 'Illuminate\\Queue\\Events\\WorkerStopping' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php', 'Illuminate\\Queue\\Failed\\DatabaseFailedJobProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php', 'Illuminate\\Queue\\Failed\\FailedJobProviderInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php', 'Illuminate\\Queue\\Failed\\NullFailedJobProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Failed/NullFailedJobProvider.php', 'Illuminate\\Queue\\InteractsWithQueue' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php', - 'Illuminate\\Queue\\IronQueue' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/IronQueue.php', 'Illuminate\\Queue\\Jobs\\BeanstalkdJob' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Jobs/BeanstalkdJob.php', 'Illuminate\\Queue\\Jobs\\DatabaseJob' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php', - 'Illuminate\\Queue\\Jobs\\IronJob' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php', 'Illuminate\\Queue\\Jobs\\Job' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Jobs/Job.php', 'Illuminate\\Queue\\Jobs\\RedisJob' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Jobs/RedisJob.php', 'Illuminate\\Queue\\Jobs\\SqsJob' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php', @@ -753,13 +837,16 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Routing\\Controller' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Controller.php', 'Illuminate\\Routing\\ControllerDispatcher' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php', 'Illuminate\\Routing\\ControllerInspector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/ControllerInspector.php', - 'Illuminate\\Routing\\ControllerServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php', - 'Illuminate\\Routing\\GeneratorServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/GeneratorServiceProvider.php', + 'Illuminate\\Routing\\ControllerMiddlewareOptions' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php', + 'Illuminate\\Routing\\Events\\RouteMatched' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php', + 'Illuminate\\Routing\\Exceptions\\UrlGenerationException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php', 'Illuminate\\Routing\\Matching\\HostValidator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php', 'Illuminate\\Routing\\Matching\\MethodValidator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Matching/MethodValidator.php', 'Illuminate\\Routing\\Matching\\SchemeValidator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Matching/SchemeValidator.php', 'Illuminate\\Routing\\Matching\\UriValidator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Matching/UriValidator.php', 'Illuminate\\Routing\\Matching\\ValidatorInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php', + 'Illuminate\\Routing\\Middleware\\ThrottleRequests' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php', + 'Illuminate\\Routing\\Pipeline' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Pipeline.php', 'Illuminate\\Routing\\Redirector' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/Redirector.php', 'Illuminate\\Routing\\ResourceRegistrar' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php', 'Illuminate\\Routing\\ResponseFactory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/ResponseFactory.php', @@ -770,13 +857,13 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Routing\\RoutingServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php', 'Illuminate\\Routing\\UrlGenerator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Routing/UrlGenerator.php', 'Illuminate\\Session\\CacheBasedSessionHandler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php', - 'Illuminate\\Session\\CommandsServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/CommandsServiceProvider.php', 'Illuminate\\Session\\Console\\SessionTableCommand' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php', 'Illuminate\\Session\\CookieSessionHandler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php', 'Illuminate\\Session\\DatabaseSessionHandler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php', 'Illuminate\\Session\\EncryptedStore' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/EncryptedStore.php', 'Illuminate\\Session\\ExistenceAwareInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/ExistenceAwareInterface.php', 'Illuminate\\Session\\FileSessionHandler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/FileSessionHandler.php', + 'Illuminate\\Session\\LegacyDatabaseSessionHandler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/LegacyDatabaseSessionHandler.php', 'Illuminate\\Session\\Middleware\\StartSession' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php', 'Illuminate\\Session\\SessionInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/SessionInterface.php', 'Illuminate\\Session\\SessionManager' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/SessionManager.php', @@ -787,6 +874,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Support\\Arr' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Arr.php', 'Illuminate\\Support\\ClassLoader' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/ClassLoader.php', 'Illuminate\\Support\\Collection' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Collection.php', + 'Illuminate\\Support\\Composer' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Composer.php', 'Illuminate\\Support\\Debug\\Dumper' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Debug/Dumper.php', 'Illuminate\\Support\\Debug\\HtmlDumper' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Debug/HtmlDumper.php', 'Illuminate\\Support\\Facades\\App' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Facades/App.php', @@ -832,6 +920,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php', 'Illuminate\\Support\\Traits\\Macroable' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Traits/Macroable.php', 'Illuminate\\Support\\ViewErrorBag' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/ViewErrorBag.php', + 'Illuminate\\Translation\\ArrayLoader' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Translation/ArrayLoader.php', 'Illuminate\\Translation\\FileLoader' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Translation/FileLoader.php', 'Illuminate\\Translation\\LoaderInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Translation/LoaderInterface.php', 'Illuminate\\Translation\\TranslationServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php', @@ -840,6 +929,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Illuminate\\Validation\\Factory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Validation/Factory.php', 'Illuminate\\Validation\\PresenceVerifierInterface' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php', 'Illuminate\\Validation\\ValidatesWhenResolvedTrait' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php', + 'Illuminate\\Validation\\ValidationException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Validation/ValidationException.php', 'Illuminate\\Validation\\ValidationServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php', 'Illuminate\\Validation\\Validator' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Validation/Validator.php', 'Illuminate\\View\\Compilers\\BladeCompiler' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php', @@ -877,15 +967,19 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'League\\Flysystem\\Adapter\\SynologyFtp' => __DIR__ . '/..' . '/league/flysystem/src/Adapter/SynologyFtp.php', 'League\\Flysystem\\Config' => __DIR__ . '/..' . '/league/flysystem/src/Config.php', 'League\\Flysystem\\ConfigAwareTrait' => __DIR__ . '/..' . '/league/flysystem/src/ConfigAwareTrait.php', + 'League\\Flysystem\\ConnectionErrorException' => __DIR__ . '/..' . '/league/flysystem/src/ConnectionErrorException.php', + 'League\\Flysystem\\ConnectionRuntimeException' => __DIR__ . '/..' . '/league/flysystem/src/ConnectionRuntimeException.php', 'League\\Flysystem\\Directory' => __DIR__ . '/..' . '/league/flysystem/src/Directory.php', 'League\\Flysystem\\Exception' => __DIR__ . '/..' . '/league/flysystem/src/Exception.php', 'League\\Flysystem\\File' => __DIR__ . '/..' . '/league/flysystem/src/File.php', 'League\\Flysystem\\FileExistsException' => __DIR__ . '/..' . '/league/flysystem/src/FileExistsException.php', 'League\\Flysystem\\FileNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/FileNotFoundException.php', 'League\\Flysystem\\Filesystem' => __DIR__ . '/..' . '/league/flysystem/src/Filesystem.php', + 'League\\Flysystem\\FilesystemException' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemException.php', 'League\\Flysystem\\FilesystemInterface' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemInterface.php', 'League\\Flysystem\\FilesystemNotFoundException' => __DIR__ . '/..' . '/league/flysystem/src/FilesystemNotFoundException.php', 'League\\Flysystem\\Handler' => __DIR__ . '/..' . '/league/flysystem/src/Handler.php', + 'League\\Flysystem\\InvalidRootException' => __DIR__ . '/..' . '/league/flysystem/src/InvalidRootException.php', 'League\\Flysystem\\MountManager' => __DIR__ . '/..' . '/league/flysystem/src/MountManager.php', 'League\\Flysystem\\NotSupportedException' => __DIR__ . '/..' . '/league/flysystem/src/NotSupportedException.php', 'League\\Flysystem\\PluginInterface' => __DIR__ . '/..' . '/league/flysystem/src/PluginInterface.php', @@ -907,6 +1001,12 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'League\\Flysystem\\Util\\ContentListingFormatter' => __DIR__ . '/..' . '/league/flysystem/src/Util/ContentListingFormatter.php', 'League\\Flysystem\\Util\\MimeType' => __DIR__ . '/..' . '/league/flysystem/src/Util/MimeType.php', 'League\\Flysystem\\Util\\StreamHasher' => __DIR__ . '/..' . '/league/flysystem/src/Util/StreamHasher.php', + 'League\\MimeTypeDetection\\EmptyExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\ExtensionMimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionMimeTypeDetector.php', + 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/ExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\FinfoMimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/FinfoMimeTypeDetector.php', + 'League\\MimeTypeDetection\\GeneratedExtensionToMimeTypeMap' => __DIR__ . '/..' . '/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php', + 'League\\MimeTypeDetection\\MimeTypeDetector' => __DIR__ . '/..' . '/league/mime-type-detection/src/MimeTypeDetector.php', 'Monolog\\ErrorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ErrorHandler.php', 'Monolog\\Formatter\\ChromePHPFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php', 'Monolog\\Formatter\\ElasticaFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php', @@ -1209,7 +1309,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php', 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'Psy\\Autoloader' => __DIR__ . '/..' . '/psy/psysh/src/Psy/Autoloader.php', @@ -1317,9 +1417,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Psy\\VarDumper\\Dumper' => __DIR__ . '/..' . '/psy/psysh/src/Psy/VarDumper/Dumper.php', 'Psy\\VarDumper\\Presenter' => __DIR__ . '/..' . '/psy/psysh/src/Psy/VarDumper/Presenter.php', 'Psy\\VarDumper\\PresenterAware' => __DIR__ . '/..' . '/psy/psysh/src/Psy/VarDumper/PresenterAware.php', - 'SessionHandlerInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Resources/stubs/SessionHandlerInterface.php', - 'Stringy\\StaticStringy' => __DIR__ . '/..' . '/danielstjules/stringy/src/StaticStringy.php', - 'Stringy\\Stringy' => __DIR__ . '/..' . '/danielstjules/stringy/src/Stringy.php', 'SuperClosure\\Analyzer\\AstAnalyzer' => __DIR__ . '/..' . '/jeremeamia/superclosure/src/Analyzer/AstAnalyzer.php', 'SuperClosure\\Analyzer\\ClosureAnalyzer' => __DIR__ . '/..' . '/jeremeamia/superclosure/src/Analyzer/ClosureAnalyzer.php', 'SuperClosure\\Analyzer\\Token' => __DIR__ . '/..' . '/jeremeamia/superclosure/src/Analyzer/Token.php', @@ -1350,6 +1447,11 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Console\\Event\\ConsoleEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleEvent.php', 'Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleExceptionEvent.php', 'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleTerminateEvent.php', + 'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/CommandNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/console/Exception/ExceptionInterface.php', + 'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidArgumentException.php', + 'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidOptionException.php', + 'Symfony\\Component\\Console\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/console/Exception/LogicException.php', 'Symfony\\Component\\Console\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/console/Exception/RuntimeException.php', 'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatter.php', 'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterInterface.php', @@ -1358,7 +1460,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleStack.php', 'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DebugFormatterHelper.php', 'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DescriptorHelper.php', - 'Symfony\\Component\\Console\\Helper\\DialogHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DialogHelper.php', 'Symfony\\Component\\Console\\Helper\\FormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/FormatterHelper.php', 'Symfony\\Component\\Console\\Helper\\Helper' => __DIR__ . '/..' . '/symfony/console/Helper/Helper.php', 'Symfony\\Component\\Console\\Helper\\HelperInterface' => __DIR__ . '/..' . '/symfony/console/Helper/HelperInterface.php', @@ -1366,12 +1467,11 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Console\\Helper\\InputAwareHelper' => __DIR__ . '/..' . '/symfony/console/Helper/InputAwareHelper.php', 'Symfony\\Component\\Console\\Helper\\ProcessHelper' => __DIR__ . '/..' . '/symfony/console/Helper/ProcessHelper.php', 'Symfony\\Component\\Console\\Helper\\ProgressBar' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressBar.php', - 'Symfony\\Component\\Console\\Helper\\ProgressHelper' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressHelper.php', + 'Symfony\\Component\\Console\\Helper\\ProgressIndicator' => __DIR__ . '/..' . '/symfony/console/Helper/ProgressIndicator.php', 'Symfony\\Component\\Console\\Helper\\QuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/QuestionHelper.php', 'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/SymfonyQuestionHelper.php', 'Symfony\\Component\\Console\\Helper\\Table' => __DIR__ . '/..' . '/symfony/console/Helper/Table.php', 'Symfony\\Component\\Console\\Helper\\TableCell' => __DIR__ . '/..' . '/symfony/console/Helper/TableCell.php', - 'Symfony\\Component\\Console\\Helper\\TableHelper' => __DIR__ . '/..' . '/symfony/console/Helper/TableHelper.php', 'Symfony\\Component\\Console\\Helper\\TableSeparator' => __DIR__ . '/..' . '/symfony/console/Helper/TableSeparator.php', 'Symfony\\Component\\Console\\Helper\\TableStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableStyle.php', 'Symfony\\Component\\Console\\Input\\ArgvInput' => __DIR__ . '/..' . '/symfony/console/Input/ArgvInput.php', @@ -1394,13 +1494,11 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ChoiceQuestion.php', 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ConfirmationQuestion.php', 'Symfony\\Component\\Console\\Question\\Question' => __DIR__ . '/..' . '/symfony/console/Question/Question.php', - 'Symfony\\Component\\Console\\Shell' => __DIR__ . '/..' . '/symfony/console/Shell.php', 'Symfony\\Component\\Console\\Style\\OutputStyle' => __DIR__ . '/..' . '/symfony/console/Style/OutputStyle.php', 'Symfony\\Component\\Console\\Style\\StyleInterface' => __DIR__ . '/..' . '/symfony/console/Style/StyleInterface.php', 'Symfony\\Component\\Console\\Style\\SymfonyStyle' => __DIR__ . '/..' . '/symfony/console/Style/SymfonyStyle.php', 'Symfony\\Component\\Console\\Tester\\ApplicationTester' => __DIR__ . '/..' . '/symfony/console/Tester/ApplicationTester.php', 'Symfony\\Component\\Console\\Tester\\CommandTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandTester.php', - 'Symfony\\Component\\CssSelector\\CssSelector' => __DIR__ . '/..' . '/symfony/css-selector/CssSelector.php', 'Symfony\\Component\\CssSelector\\CssSelectorConverter' => __DIR__ . '/..' . '/symfony/css-selector/CssSelectorConverter.php', 'Symfony\\Component\\CssSelector\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/css-selector/Exception/ExceptionInterface.php', 'Symfony\\Component\\CssSelector\\Exception\\ExpressionErrorException' => __DIR__ . '/..' . '/symfony/css-selector/Exception/ExpressionErrorException.php', @@ -1449,14 +1547,13 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\CssSelector\\XPath\\Translator' => __DIR__ . '/..' . '/symfony/css-selector/XPath/Translator.php', 'Symfony\\Component\\CssSelector\\XPath\\TranslatorInterface' => __DIR__ . '/..' . '/symfony/css-selector/XPath/TranslatorInterface.php', 'Symfony\\Component\\CssSelector\\XPath\\XPathExpr' => __DIR__ . '/..' . '/symfony/css-selector/XPath/XPathExpr.php', + 'Symfony\\Component\\Debug\\BufferingLogger' => __DIR__ . '/..' . '/symfony/debug/BufferingLogger.php', 'Symfony\\Component\\Debug\\Debug' => __DIR__ . '/..' . '/symfony/debug/Debug.php', 'Symfony\\Component\\Debug\\DebugClassLoader' => __DIR__ . '/..' . '/symfony/debug/DebugClassLoader.php', 'Symfony\\Component\\Debug\\ErrorHandler' => __DIR__ . '/..' . '/symfony/debug/ErrorHandler.php', - 'Symfony\\Component\\Debug\\ErrorHandlerCanary' => __DIR__ . '/..' . '/symfony/debug/ErrorHandler.php', 'Symfony\\Component\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/symfony/debug/ExceptionHandler.php', 'Symfony\\Component\\Debug\\Exception\\ClassNotFoundException' => __DIR__ . '/..' . '/symfony/debug/Exception/ClassNotFoundException.php', 'Symfony\\Component\\Debug\\Exception\\ContextErrorException' => __DIR__ . '/..' . '/symfony/debug/Exception/ContextErrorException.php', - 'Symfony\\Component\\Debug\\Exception\\DummyException' => __DIR__ . '/..' . '/symfony/debug/Exception/DummyException.php', 'Symfony\\Component\\Debug\\Exception\\FatalErrorException' => __DIR__ . '/..' . '/symfony/debug/Exception/FatalErrorException.php', 'Symfony\\Component\\Debug\\Exception\\FatalThrowableError' => __DIR__ . '/..' . '/symfony/debug/Exception/FatalThrowableError.php', 'Symfony\\Component\\Debug\\Exception\\FlattenException' => __DIR__ . '/..' . '/symfony/debug/Exception/FlattenException.php', @@ -1467,6 +1564,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Debug\\FatalErrorHandler\\FatalErrorHandlerInterface' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php', 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedFunctionFatalErrorHandler' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php', 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedMethodFatalErrorHandler' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php', + 'Symfony\\Component\\DomCrawler\\AbstractUriElement' => __DIR__ . '/..' . '/symfony/dom-crawler/AbstractUriElement.php', 'Symfony\\Component\\DomCrawler\\Crawler' => __DIR__ . '/..' . '/symfony/dom-crawler/Crawler.php', 'Symfony\\Component\\DomCrawler\\Field\\ChoiceFormField' => __DIR__ . '/..' . '/symfony/dom-crawler/Field/ChoiceFormField.php', 'Symfony\\Component\\DomCrawler\\Field\\FileFormField' => __DIR__ . '/..' . '/symfony/dom-crawler/Field/FileFormField.php', @@ -1475,11 +1573,13 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\DomCrawler\\Field\\TextareaFormField' => __DIR__ . '/..' . '/symfony/dom-crawler/Field/TextareaFormField.php', 'Symfony\\Component\\DomCrawler\\Form' => __DIR__ . '/..' . '/symfony/dom-crawler/Form.php', 'Symfony\\Component\\DomCrawler\\FormFieldRegistry' => __DIR__ . '/..' . '/symfony/dom-crawler/FormFieldRegistry.php', + 'Symfony\\Component\\DomCrawler\\Image' => __DIR__ . '/..' . '/symfony/dom-crawler/Image.php', 'Symfony\\Component\\DomCrawler\\Link' => __DIR__ . '/..' . '/symfony/dom-crawler/Link.php', 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher' => __DIR__ . '/..' . '/symfony/event-dispatcher/ContainerAwareEventDispatcher.php', 'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher' => __DIR__ . '/..' . '/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php', 'Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcherInterface' => __DIR__ . '/..' . '/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php', 'Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener' => __DIR__ . '/..' . '/symfony/event-dispatcher/Debug/WrappedListener.php', + 'Symfony\\Component\\EventDispatcher\\DependencyInjection\\ExtractingEventDispatcher' => __DIR__ . '/..' . '/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php', 'Symfony\\Component\\EventDispatcher\\DependencyInjection\\RegisterListenersPass' => __DIR__ . '/..' . '/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php', 'Symfony\\Component\\EventDispatcher\\Event' => __DIR__ . '/..' . '/symfony/event-dispatcher/Event.php', 'Symfony\\Component\\EventDispatcher\\EventDispatcher' => __DIR__ . '/..' . '/symfony/event-dispatcher/EventDispatcher.php', @@ -1487,31 +1587,17 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface' => __DIR__ . '/..' . '/symfony/event-dispatcher/EventSubscriberInterface.php', 'Symfony\\Component\\EventDispatcher\\GenericEvent' => __DIR__ . '/..' . '/symfony/event-dispatcher/GenericEvent.php', 'Symfony\\Component\\EventDispatcher\\ImmutableEventDispatcher' => __DIR__ . '/..' . '/symfony/event-dispatcher/ImmutableEventDispatcher.php', - 'Symfony\\Component\\Finder\\Adapter\\AbstractAdapter' => __DIR__ . '/..' . '/symfony/finder/Adapter/AbstractAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\AbstractFindAdapter' => __DIR__ . '/..' . '/symfony/finder/Adapter/AbstractFindAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\AdapterInterface' => __DIR__ . '/..' . '/symfony/finder/Adapter/AdapterInterface.php', - 'Symfony\\Component\\Finder\\Adapter\\BsdFindAdapter' => __DIR__ . '/..' . '/symfony/finder/Adapter/BsdFindAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\GnuFindAdapter' => __DIR__ . '/..' . '/symfony/finder/Adapter/GnuFindAdapter.php', - 'Symfony\\Component\\Finder\\Adapter\\PhpAdapter' => __DIR__ . '/..' . '/symfony/finder/Adapter/PhpAdapter.php', 'Symfony\\Component\\Finder\\Comparator\\Comparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/Comparator.php', 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/DateComparator.php', 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => __DIR__ . '/..' . '/symfony/finder/Comparator/NumberComparator.php', 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => __DIR__ . '/..' . '/symfony/finder/Exception/AccessDeniedException.php', - 'Symfony\\Component\\Finder\\Exception\\AdapterFailureException' => __DIR__ . '/..' . '/symfony/finder/Exception/AdapterFailureException.php', 'Symfony\\Component\\Finder\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/finder/Exception/ExceptionInterface.php', - 'Symfony\\Component\\Finder\\Exception\\OperationNotPermitedException' => __DIR__ . '/..' . '/symfony/finder/Exception/OperationNotPermitedException.php', - 'Symfony\\Component\\Finder\\Exception\\ShellCommandFailureException' => __DIR__ . '/..' . '/symfony/finder/Exception/ShellCommandFailureException.php', - 'Symfony\\Component\\Finder\\Expression\\Expression' => __DIR__ . '/..' . '/symfony/finder/Expression/Expression.php', - 'Symfony\\Component\\Finder\\Expression\\Glob' => __DIR__ . '/..' . '/symfony/finder/Expression/Glob.php', - 'Symfony\\Component\\Finder\\Expression\\Regex' => __DIR__ . '/..' . '/symfony/finder/Expression/Regex.php', - 'Symfony\\Component\\Finder\\Expression\\ValueInterface' => __DIR__ . '/..' . '/symfony/finder/Expression/ValueInterface.php', 'Symfony\\Component\\Finder\\Finder' => __DIR__ . '/..' . '/symfony/finder/Finder.php', 'Symfony\\Component\\Finder\\Glob' => __DIR__ . '/..' . '/symfony/finder/Glob.php', 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/CustomFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DateRangeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/DepthRangeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php', - 'Symfony\\Component\\Finder\\Iterator\\FilePathsIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilePathsIterator.php', 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FileTypeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilecontentFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/FilenameFilterIterator.php', @@ -1521,8 +1607,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php', 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/SizeRangeFilterIterator.php', 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => __DIR__ . '/..' . '/symfony/finder/Iterator/SortableIterator.php', - 'Symfony\\Component\\Finder\\Shell\\Command' => __DIR__ . '/..' . '/symfony/finder/Shell/Command.php', - 'Symfony\\Component\\Finder\\Shell\\Shell' => __DIR__ . '/..' . '/symfony/finder/Shell/Shell.php', 'Symfony\\Component\\Finder\\SplFileInfo' => __DIR__ . '/..' . '/symfony/finder/SplFileInfo.php', 'Symfony\\Component\\HttpFoundation\\AcceptHeader' => __DIR__ . '/..' . '/symfony/http-foundation/AcceptHeader.php', 'Symfony\\Component\\HttpFoundation\\AcceptHeaderItem' => __DIR__ . '/..' . '/symfony/http-foundation/AcceptHeaderItem.php', @@ -1567,7 +1651,6 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\HttpFoundation\\Session\\Session' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Session.php', 'Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/SessionBagInterface.php', 'Symfony\\Component\\HttpFoundation\\Session\\SessionInterface' => __DIR__ . '/..' . '/symfony/http-foundation/Session/SessionInterface.php', - 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\LegacyPdoSessionHandler' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/Handler/LegacyPdoSessionHandler.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcacheSessionHandler' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcachedSessionHandler' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php', 'Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MongoDbSessionHandler' => __DIR__ . '/..' . '/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php', @@ -1601,6 +1684,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver' => __DIR__ . '/..' . '/symfony/http-kernel/Controller/ControllerResolver.php', 'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface' => __DIR__ . '/..' . '/symfony/http-kernel/Controller/ControllerResolverInterface.php', 'Symfony\\Component\\HttpKernel\\Controller\\TraceableControllerResolver' => __DIR__ . '/..' . '/symfony/http-kernel/Controller/TraceableControllerResolver.php', + 'Symfony\\Component\\HttpKernel\\DataCollector\\AjaxDataCollector' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/AjaxDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\ConfigDataCollector' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/ConfigDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/DataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollectorInterface' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/DataCollectorInterface.php', @@ -1614,22 +1698,16 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\HttpKernel\\DataCollector\\RouterDataCollector' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/RouterDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\TimeDataCollector' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/TimeDataCollector.php', 'Symfony\\Component\\HttpKernel\\DataCollector\\Util\\ValueExporter' => __DIR__ . '/..' . '/symfony/http-kernel/DataCollector/Util/ValueExporter.php', - 'Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler' => __DIR__ . '/..' . '/symfony/http-kernel/Debug/ErrorHandler.php', - 'Symfony\\Component\\HttpKernel\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/symfony/http-kernel/Debug/ExceptionHandler.php', 'Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher' => __DIR__ . '/..' . '/symfony/http-kernel/Debug/TraceableEventDispatcher.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\AddClassesToCachePass' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/AddClassesToCachePass.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ConfigurableExtension' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php', - 'Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\Extension' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/Extension.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\FragmentRendererPass' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\LazyLoadingFragmentHandler' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php', 'Symfony\\Component\\HttpKernel\\DependencyInjection\\MergeExtensionConfigurationPass' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php', - 'Symfony\\Component\\HttpKernel\\DependencyInjection\\RegisterListenersPass' => __DIR__ . '/..' . '/symfony/http-kernel/DependencyInjection/RegisterListenersPass.php', 'Symfony\\Component\\HttpKernel\\EventListener\\AddRequestFormatsListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/AddRequestFormatsListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/DebugHandlersListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\DumpListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/DumpListener.php', - 'Symfony\\Component\\HttpKernel\\EventListener\\ErrorsLoggerListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/ErrorsLoggerListener.php', - 'Symfony\\Component\\HttpKernel\\EventListener\\EsiListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/EsiListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/ExceptionListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\FragmentListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/FragmentListener.php', 'Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener' => __DIR__ . '/..' . '/symfony/http-kernel/EventListener/LocaleListener.php', @@ -1677,15 +1755,12 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\HttpKernel\\Fragment\\RoutableFragmentRenderer' => __DIR__ . '/..' . '/symfony/http-kernel/Fragment/RoutableFragmentRenderer.php', 'Symfony\\Component\\HttpKernel\\Fragment\\SsiFragmentRenderer' => __DIR__ . '/..' . '/symfony/http-kernel/Fragment/SsiFragmentRenderer.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\Esi' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/Esi.php', - 'Symfony\\Component\\HttpKernel\\HttpCache\\EsiResponseCacheStrategy' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/EsiResponseCacheStrategy.php', - 'Symfony\\Component\\HttpKernel\\HttpCache\\EsiResponseCacheStrategyInterface' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/EsiResponseCacheStrategyInterface.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/HttpCache.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\ResponseCacheStrategy' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\ResponseCacheStrategyInterface' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/ResponseCacheStrategyInterface.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\Ssi' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/Ssi.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\Store' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/Store.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/StoreInterface.php', - 'Symfony\\Component\\HttpKernel\\HttpCache\\SubRequestHandler' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/SubRequestHandler.php', 'Symfony\\Component\\HttpKernel\\HttpCache\\SurrogateInterface' => __DIR__ . '/..' . '/symfony/http-kernel/HttpCache/SurrogateInterface.php', 'Symfony\\Component\\HttpKernel\\HttpKernel' => __DIR__ . '/..' . '/symfony/http-kernel/HttpKernel.php', 'Symfony\\Component\\HttpKernel\\HttpKernelInterface' => __DIR__ . '/..' . '/symfony/http-kernel/HttpKernelInterface.php', @@ -1693,20 +1768,10 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\HttpKernel\\KernelEvents' => __DIR__ . '/..' . '/symfony/http-kernel/KernelEvents.php', 'Symfony\\Component\\HttpKernel\\KernelInterface' => __DIR__ . '/..' . '/symfony/http-kernel/KernelInterface.php', 'Symfony\\Component\\HttpKernel\\Log\\DebugLoggerInterface' => __DIR__ . '/..' . '/symfony/http-kernel/Log/DebugLoggerInterface.php', - 'Symfony\\Component\\HttpKernel\\Log\\LoggerInterface' => __DIR__ . '/..' . '/symfony/http-kernel/Log/LoggerInterface.php', - 'Symfony\\Component\\HttpKernel\\Log\\NullLogger' => __DIR__ . '/..' . '/symfony/http-kernel/Log/NullLogger.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\BaseMemcacheProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/BaseMemcacheProfilerStorage.php', 'Symfony\\Component\\HttpKernel\\Profiler\\FileProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/FileProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MemcacheProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/MemcacheProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MemcachedProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/MemcachedProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MongoDbProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/MongoDbProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\MysqlProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/MysqlProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\PdoProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/PdoProfilerStorage.php', 'Symfony\\Component\\HttpKernel\\Profiler\\Profile' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/Profile.php', 'Symfony\\Component\\HttpKernel\\Profiler\\Profiler' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/Profiler.php', 'Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/ProfilerStorageInterface.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\RedisProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/RedisProfilerStorage.php', - 'Symfony\\Component\\HttpKernel\\Profiler\\SqliteProfilerStorage' => __DIR__ . '/..' . '/symfony/http-kernel/Profiler/SqliteProfilerStorage.php', 'Symfony\\Component\\HttpKernel\\TerminableInterface' => __DIR__ . '/..' . '/symfony/http-kernel/TerminableInterface.php', 'Symfony\\Component\\HttpKernel\\UriSigner' => __DIR__ . '/..' . '/symfony/http-kernel/UriSigner.php', 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/process/Exception/ExceptionInterface.php', @@ -1743,12 +1808,12 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Routing\\Loader\\AnnotationDirectoryLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/AnnotationDirectoryLoader.php', 'Symfony\\Component\\Routing\\Loader\\AnnotationFileLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/AnnotationFileLoader.php', 'Symfony\\Component\\Routing\\Loader\\ClosureLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/ClosureLoader.php', + 'Symfony\\Component\\Routing\\Loader\\DependencyInjection\\ServiceRouterLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php', + 'Symfony\\Component\\Routing\\Loader\\DirectoryLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/DirectoryLoader.php', + 'Symfony\\Component\\Routing\\Loader\\ObjectRouteLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/ObjectRouteLoader.php', 'Symfony\\Component\\Routing\\Loader\\PhpFileLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/PhpFileLoader.php', - 'Symfony\\Component\\Routing\\Loader\\RecursiveCallbackFilterIterator' => __DIR__ . '/..' . '/symfony/routing/Loader/AnnotationDirectoryLoader.php', 'Symfony\\Component\\Routing\\Loader\\XmlFileLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/XmlFileLoader.php', 'Symfony\\Component\\Routing\\Loader\\YamlFileLoader' => __DIR__ . '/..' . '/symfony/routing/Loader/YamlFileLoader.php', - 'Symfony\\Component\\Routing\\Matcher\\ApacheUrlMatcher' => __DIR__ . '/..' . '/symfony/routing/Matcher/ApacheUrlMatcher.php', - 'Symfony\\Component\\Routing\\Matcher\\Dumper\\ApacheMatcherDumper' => __DIR__ . '/..' . '/symfony/routing/Matcher/Dumper/ApacheMatcherDumper.php', 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperCollection' => __DIR__ . '/..' . '/symfony/routing/Matcher/Dumper/DumperCollection.php', 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperPrefixCollection' => __DIR__ . '/..' . '/symfony/routing/Matcher/Dumper/DumperPrefixCollection.php', 'Symfony\\Component\\Routing\\Matcher\\Dumper\\DumperRoute' => __DIR__ . '/..' . '/symfony/routing/Matcher/Dumper/DumperRoute.php', @@ -1765,14 +1830,15 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Routing\\RequestContextAwareInterface' => __DIR__ . '/..' . '/symfony/routing/RequestContextAwareInterface.php', 'Symfony\\Component\\Routing\\Route' => __DIR__ . '/..' . '/symfony/routing/Route.php', 'Symfony\\Component\\Routing\\RouteCollection' => __DIR__ . '/..' . '/symfony/routing/RouteCollection.php', + 'Symfony\\Component\\Routing\\RouteCollectionBuilder' => __DIR__ . '/..' . '/symfony/routing/RouteCollectionBuilder.php', 'Symfony\\Component\\Routing\\RouteCompiler' => __DIR__ . '/..' . '/symfony/routing/RouteCompiler.php', 'Symfony\\Component\\Routing\\RouteCompilerInterface' => __DIR__ . '/..' . '/symfony/routing/RouteCompilerInterface.php', 'Symfony\\Component\\Routing\\Router' => __DIR__ . '/..' . '/symfony/routing/Router.php', 'Symfony\\Component\\Routing\\RouterInterface' => __DIR__ . '/..' . '/symfony/routing/RouterInterface.php', 'Symfony\\Component\\Translation\\Catalogue\\AbstractOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/AbstractOperation.php', - 'Symfony\\Component\\Translation\\Catalogue\\DiffOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/DiffOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\MergeOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/MergeOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\OperationInterface' => __DIR__ . '/..' . '/symfony/translation/Catalogue/OperationInterface.php', + 'Symfony\\Component\\Translation\\Catalogue\\TargetOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/TargetOperation.php', 'Symfony\\Component\\Translation\\DataCollectorTranslator' => __DIR__ . '/..' . '/symfony/translation/DataCollectorTranslator.php', 'Symfony\\Component\\Translation\\DataCollector\\TranslationDataCollector' => __DIR__ . '/..' . '/symfony/translation/DataCollector/TranslationDataCollector.php', 'Symfony\\Component\\Translation\\Dumper\\CsvFileDumper' => __DIR__ . '/..' . '/symfony/translation/Dumper/CsvFileDumper.php', @@ -1797,6 +1863,7 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Translation\\Interval' => __DIR__ . '/..' . '/symfony/translation/Interval.php', 'Symfony\\Component\\Translation\\Loader\\ArrayLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/ArrayLoader.php', 'Symfony\\Component\\Translation\\Loader\\CsvFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/CsvFileLoader.php', + 'Symfony\\Component\\Translation\\Loader\\FileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/FileLoader.php', 'Symfony\\Component\\Translation\\Loader\\IcuDatFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/IcuDatFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\IcuResFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/IcuResFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\IniFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/IniFileLoader.php', @@ -1817,20 +1884,26 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\Translation\\Translator' => __DIR__ . '/..' . '/symfony/translation/Translator.php', 'Symfony\\Component\\Translation\\TranslatorBagInterface' => __DIR__ . '/..' . '/symfony/translation/TranslatorBagInterface.php', 'Symfony\\Component\\Translation\\TranslatorInterface' => __DIR__ . '/..' . '/symfony/translation/TranslatorInterface.php', + 'Symfony\\Component\\Translation\\Util\\ArrayConverter' => __DIR__ . '/..' . '/symfony/translation/Util/ArrayConverter.php', 'Symfony\\Component\\Translation\\Writer\\TranslationWriter' => __DIR__ . '/..' . '/symfony/translation/Writer/TranslationWriter.php', 'Symfony\\Component\\VarDumper\\Caster\\AmqpCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/AmqpCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\Caster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/Caster.php', 'Symfony\\Component\\VarDumper\\Caster\\ConstStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ConstStub.php', + 'Symfony\\Component\\VarDumper\\Caster\\CutArrayStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/CutArrayStub.php', 'Symfony\\Component\\VarDumper\\Caster\\CutStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/CutStub.php', 'Symfony\\Component\\VarDumper\\Caster\\DOMCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DOMCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\DoctrineCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/DoctrineCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\EnumStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/EnumStub.php', 'Symfony\\Component\\VarDumper\\Caster\\ExceptionCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ExceptionCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\FrameStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/FrameStub.php', 'Symfony\\Component\\VarDumper\\Caster\\MongoCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/MongoCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\PdoCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/PdoCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\PgSqlCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/PgSqlCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ReflectionCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ReflectionCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\ResourceCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/ResourceCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\SplCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/SplCaster.php', 'Symfony\\Component\\VarDumper\\Caster\\StubCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/StubCaster.php', + 'Symfony\\Component\\VarDumper\\Caster\\TraceStub' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/TraceStub.php', 'Symfony\\Component\\VarDumper\\Caster\\XmlResourceCaster' => __DIR__ . '/..' . '/symfony/var-dumper/Caster/XmlResourceCaster.php', 'Symfony\\Component\\VarDumper\\Cloner\\AbstractCloner' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/AbstractCloner.php', 'Symfony\\Component\\VarDumper\\Cloner\\ClonerInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Cloner/ClonerInterface.php', @@ -1844,20 +1917,10 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/DataDumperInterface.php', 'Symfony\\Component\\VarDumper\\Dumper\\HtmlDumper' => __DIR__ . '/..' . '/symfony/var-dumper/Dumper/HtmlDumper.php', 'Symfony\\Component\\VarDumper\\Exception\\ThrowingCasterException' => __DIR__ . '/..' . '/symfony/var-dumper/Exception/ThrowingCasterException.php', - 'Symfony\\Component\\VarDumper\\Test\\VarDumperTestCase' => __DIR__ . '/..' . '/symfony/var-dumper/Test/VarDumperTestCase.php', 'Symfony\\Component\\VarDumper\\Test\\VarDumperTestTrait' => __DIR__ . '/..' . '/symfony/var-dumper/Test/VarDumperTestTrait.php', 'Symfony\\Component\\VarDumper\\VarDumper' => __DIR__ . '/..' . '/symfony/var-dumper/VarDumper.php', 'Symfony\\Polyfill\\Ctype\\Ctype' => __DIR__ . '/..' . '/symfony/polyfill-ctype/Ctype.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php', - 'Symfony\\Polyfill\\Php56\\Php56' => __DIR__ . '/..' . '/symfony/polyfill-php56/Php56.php', - 'Symfony\\Polyfill\\Util\\Binary' => __DIR__ . '/..' . '/symfony/polyfill-util/Binary.php', - 'Symfony\\Polyfill\\Util\\BinaryNoFuncOverload' => __DIR__ . '/..' . '/symfony/polyfill-util/BinaryNoFuncOverload.php', - 'Symfony\\Polyfill\\Util\\BinaryOnFuncOverload' => __DIR__ . '/..' . '/symfony/polyfill-util/BinaryOnFuncOverload.php', - 'Symfony\\Polyfill\\Util\\TestListener' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListener.php', - 'Symfony\\Polyfill\\Util\\TestListenerForV5' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerForV5.php', - 'Symfony\\Polyfill\\Util\\TestListenerForV6' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerForV6.php', - 'Symfony\\Polyfill\\Util\\TestListenerForV7' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerForV7.php', - 'Symfony\\Polyfill\\Util\\TestListenerTrait' => __DIR__ . '/..' . '/symfony/polyfill-util/TestListenerTrait.php', 'UpdateHelper\\ComposerPlugin' => __DIR__ . '/..' . '/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php', 'UpdateHelper\\NotUpdateInterfaceInstanceException' => __DIR__ . '/..' . '/kylekatarnls/update-helper/src/UpdateHelper/NotUpdateInterfaceInstanceException.php', 'UpdateHelper\\UpdateHelper' => __DIR__ . '/..' . '/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php', @@ -1868,11 +1931,11 @@ class ComposerStaticInit43265f891b9f29a025a40de9ffd797c4 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::$prefixDirsPsr4; - $loader->fallbackDirsPsr4 = ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::$fallbackDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::$prefixesPsr0; - $loader->classMap = ComposerStaticInit43265f891b9f29a025a40de9ffd797c4::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::$prefixDirsPsr4; + $loader->fallbackDirsPsr4 = ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::$fallbackDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::$prefixesPsr0; + $loader->classMap = ComposerStaticInitf78e08ce03e899835ef37b4c3f44d248::$classMap; }, null, ClassLoader::class); } diff --git a/application/vendor/composer/installed.json b/application/vendor/composer/installed.json index f863936..3abc49a 100644 --- a/application/vendor/composer/installed.json +++ b/application/vendor/composer/installed.json @@ -1,17 +1,17 @@ [ { "name": "classpreloader/classpreloader", - "version": "3.2.0", - "version_normalized": "3.2.0.0", + "version": "3.2.1", + "version_normalized": "3.2.1.0", "source": { "type": "git", "url": "https://github.com/ClassPreloader/ClassPreloader.git", - "reference": "4729e438e0ada350f91148e7d4bb9809342575ff" + "reference": "297db07cabece3946f4a98d23f11f90aa10e1797" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/4729e438e0ada350f91148e7d4bb9809342575ff", - "reference": "4729e438e0ada350f91148e7d4bb9809342575ff", + "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/297db07cabece3946f4a98d23f11f90aa10e1797", + "reference": "297db07cabece3946f4a98d23f11f90aa10e1797", "shasum": "" }, "require": { @@ -21,7 +21,7 @@ "require-dev": { "phpunit/phpunit": "^4.8|^5.0" }, - "time": "2017-12-10T11:40:39+00:00", + "time": "2020-04-12T22:01:25+00:00", "type": "library", "extra": { "branch-alias": { @@ -53,64 +53,12 @@ "autoload", "class", "preload" - ] - }, - { - "name": "danielstjules/stringy", - "version": "1.10.0", - "version_normalized": "1.10.0.0", - "source": { - "type": "git", - "url": "https://github.com/danielstjules/Stringy.git", - "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", - "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2015-07-23T00:54:12+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Stringy\\": "src/" - }, - "files": [ - "src/Create.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "authors": [ + "funding": [ { - "name": "Daniel St. Jules", - "email": "danielst.jules@gmail.com", - "homepage": "http://www.danielstjules.com" + "url": "https://tidelift.com/funding/github/packagist/classpreloader/classpreloader", + "type": "tidelift" } - ], - "description": "A string manipulation library with multibyte support", - "homepage": "https://github.com/danielstjules/Stringy", - "keywords": [ - "UTF", - "helpers", - "manipulation", - "methods", - "multibyte", - "string", - "utf-8", - "utility", - "utils" ] }, { @@ -150,36 +98,41 @@ }, { "name": "doctrine/inflector", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "version": "1.4.3", + "version_normalized": "1.4.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a" + "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4650c8b30c753a76bf44fb2ed00117d6f367490c", + "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "doctrine/coding-standard": "^7.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, - "time": "2018-01-09T20:05:19+00:00", + "time": "2020-05-29T07:19:59+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector", + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -187,6 +140,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -195,10 +152,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -208,13 +161,33 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "keywords": [ "inflection", - "pluralize", - "singularize", - "string" + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } ] }, { @@ -259,7 +232,8 @@ "name": "Jakub Onderka", "email": "jakub.onderka@gmail.com" } - ] + ], + "abandoned": "php-parallel-lint/php-console-color" }, { "name": "jakub-onderka/php-console-highlighter", @@ -305,7 +279,8 @@ "email": "acci@acci.cz", "homepage": "http://www.acci.cz/" } - ] + ], + "abandoned": "php-parallel-lint/php-console-highlighter" }, { "name": "jeremeamia/superclosure", @@ -365,21 +340,22 @@ "serializable", "serialize", "tokenizer" - ] + ], + "abandoned": "opis/closure" }, { "name": "kylekatarnls/update-helper", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.2.1", + "version_normalized": "1.2.1.0", "source": { "type": "git", "url": "https://github.com/kylekatarnls/update-helper.git", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e" + "reference": "429be50660ed8a196e0798e5939760f168ec8ce9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e", + "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/429be50660ed8a196e0798e5939760f168ec8ce9", + "reference": "429be50660ed8a196e0798e5939760f168ec8ce9", "shasum": "" }, "require": { @@ -391,7 +367,7 @@ "composer/composer": "2.0.x-dev || ^2.0.0-dev", "phpunit/phpunit": ">=4.8.35 <6.0" }, - "time": "2019-07-29T11:03:54+00:00", + "time": "2020-04-07T20:44:10+00:00", "type": "composer-plugin", "extra": { "class": "UpdateHelper\\ComposerPlugin" @@ -412,50 +388,62 @@ "email": "kylekatarnls@gmail.com" } ], - "description": "Update helper" + "description": "Update helper", + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ] }, { "name": "laravel/framework", - "version": "v5.1.46", - "version_normalized": "5.1.46.0", + "version": "v5.2.45", + "version_normalized": "5.2.45.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "7f2f892e62163138121e8210b92b21394fda8d1c" + "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/7f2f892e62163138121e8210b92b21394fda8d1c", - "reference": "7f2f892e62163138121e8210b92b21394fda8d1c", + "url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1", + "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1", "shasum": "" }, "require": { - "classpreloader/classpreloader": "~2.0|~3.0", - "danielstjules/stringy": "~1.8", + "classpreloader/classpreloader": "~3.0", "doctrine/inflector": "~1.0", "ext-mbstring": "*", "ext-openssl": "*", - "jeremeamia/superclosure": "~2.0", + "jeremeamia/superclosure": "~2.2", "league/flysystem": "~1.0", "monolog/monolog": "~1.11", "mtdowling/cron-expression": "~1.0", - "nesbot/carbon": "~1.19", + "nesbot/carbon": "~1.20", "paragonie/random_compat": "~1.4", "php": ">=5.5.9", "psy/psysh": "0.7.*", "swiftmailer/swiftmailer": "~5.1", - "symfony/console": "2.7.*", - "symfony/css-selector": "2.7.*|2.8.*", - "symfony/debug": "2.7.*", - "symfony/dom-crawler": "2.7.*", - "symfony/finder": "2.7.*", - "symfony/http-foundation": "2.7.*", - "symfony/http-kernel": "2.7.*", - "symfony/process": "2.7.*", - "symfony/routing": "2.7.*", - "symfony/translation": "2.7.*", - "symfony/var-dumper": "2.7.*", - "vlucas/phpdotenv": "~1.0" + "symfony/console": "2.8.*|3.0.*", + "symfony/debug": "2.8.*|3.0.*", + "symfony/finder": "2.8.*|3.0.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/http-kernel": "2.8.*|3.0.*", + "symfony/polyfill-php56": "~1.0", + "symfony/process": "2.8.*|3.0.*", + "symfony/routing": "2.8.*|3.0.*", + "symfony/translation": "2.8.*|3.0.*", + "symfony/var-dumper": "2.8.*|3.0.*", + "vlucas/phpdotenv": "~2.2" }, "replace": { "illuminate/auth": "self.version", @@ -485,34 +473,37 @@ "illuminate/support": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "tightenco/collect": "self.version" }, "require-dev": { "aws/aws-sdk-php": "~3.0", - "iron-io/iron_mq": "~2.0", "mockery/mockery": "~0.9.4", "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~4.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "~4.1", + "predis/predis": "~1.0", + "symfony/css-selector": "2.8.*|3.0.*", + "symfony/dom-crawler": "2.8.*|3.0.*" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", - "iron-io/iron_mq": "Required to use the iron queue driver (~2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." + "symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." }, - "time": "2017-03-24T16:31:45+00:00", + "time": "2016-08-26T11:44:52+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "installation-source": "dist", @@ -547,31 +538,33 @@ }, { "name": "laravelcollective/html", - "version": "v5.1.11", - "version_normalized": "5.1.11.0", + "version": "v5.2.6", + "version_normalized": "5.2.6.0", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "99342cc22507cf8d7178bb390c215968183993bb" + "reference": "4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/99342cc22507cf8d7178bb390c215968183993bb", - "reference": "99342cc22507cf8d7178bb390c215968183993bb", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e", + "reference": "4f6701c7c3f6ff2aee1f4ed205ed6820e1e3048e", "shasum": "" }, "require": { - "illuminate/http": "5.1.*", - "illuminate/routing": "5.1.*", - "illuminate/session": "5.1.*", - "illuminate/support": "5.1.*", + "illuminate/http": "5.2.*", + "illuminate/routing": "5.2.*", + "illuminate/session": "5.2.*", + "illuminate/support": "5.2.*", + "illuminate/view": "5.2.*", "php": ">=5.5.9" }, "require-dev": { + "illuminate/database": "5.2.*", "mockery/mockery": "~0.9", "phpunit/phpunit": "~4.0" }, - "time": "2017-09-07T18:12:11+00:00", + "time": "2017-05-21T18:02:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -595,33 +588,36 @@ "name": "Adam Engebretson", "email": "adam@laravelcollective.com" } - ] + ], + "description": "HTML and Form Builders for the Laravel Framework", + "homepage": "http://laravelcollective.com" }, { "name": "league/flysystem", - "version": "1.0.57", - "version_normalized": "1.0.57.0", + "version": "1.1.3", + "version_normalized": "1.1.3.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": ">=5.5.9" + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" }, "conflict": { "league/flysystem-sftp": "<1.0.6" }, "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7.10" + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -639,7 +635,7 @@ "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" }, - "time": "2019-10-16T21:01:05+00:00", + "time": "2020-08-23T07:39:11+00:00", "type": "library", "extra": { "branch-alias": { @@ -681,21 +677,80 @@ "s3", "sftp", "storage" + ], + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ] + }, + { + "name": "league/mime-type-detection", + "version": "1.5.1", + "version_normalized": "1.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.36", + "phpunit/phpunit": "^8.5.8" + }, + "time": "2020-10-18T11:50:25+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } ] }, { "name": "monolog/monolog", - "version": "1.25.1", - "version_normalized": "1.25.1.0", + "version": "1.25.5", + "version_normalized": "1.25.5.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" + "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1817faadd1846cd08be9a49e905dc68823bc38c0", + "reference": "1817faadd1846cd08be9a49e905dc68823bc38c0", "shasum": "" }, "require": { @@ -709,11 +764,10 @@ "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "^5.3|^6.0" @@ -731,7 +785,7 @@ "ruflin/elastica": "Allow sending log messages to an Elastic Search server", "sentry/sentry": "Allow sending log messages to a Sentry server" }, - "time": "2019-09-06T13:49:17+00:00", + "time": "2020-07-23T08:35:51+00:00", "type": "library", "extra": { "branch-alias": { @@ -761,21 +815,31 @@ "log", "logging", "psr-3" + ], + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } ] }, { "name": "mtdowling/cron-expression", - "version": "v1.2.1", - "version_normalized": "1.2.1.0", + "version": "v1.2.3", + "version_normalized": "1.2.3.0", "source": { "type": "git", "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad" + "reference": "9be552eebcc1ceec9776378f7dcc085246cacca6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", - "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", + "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9be552eebcc1ceec9776378f7dcc085246cacca6", + "reference": "9be552eebcc1ceec9776378f7dcc085246cacca6", "shasum": "" }, "require": { @@ -784,7 +848,7 @@ "require-dev": { "phpunit/phpunit": "~4.0|~5.0" }, - "time": "2017-01-23T04:29:33+00:00", + "time": "2019-12-28T04:23:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -807,7 +871,8 @@ "keywords": [ "cron", "schedule" - ] + ], + "abandoned": "dragonmantank/cron-expression" }, { "name": "nesbot/carbon", @@ -977,23 +1042,23 @@ }, { "name": "psr/log", - "version": "1.1.2", - "version_normalized": "1.1.2.0", + "version": "1.1.3", + "version_normalized": "1.1.3.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2019-11-01T11:05:21+00:00", + "time": "2020-03-23T09:12:05+00:00", "type": "library", "extra": { "branch-alias": { @@ -1156,38 +1221,38 @@ }, { "name": "symfony/console", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "574cb4cfaa01ba115fc2fc0c2355b2c5472a4804" + "reference": "926061e74229e935d3c5b4e9ba87237316c6693f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/574cb4cfaa01ba115fc2fc0c2355b2c5472a4804", - "reference": "574cb4cfaa01ba115fc2fc0c2355b2c5472a4804", + "url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f", + "reference": "926061e74229e935d3c5b4e9ba87237316c6693f", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/process": "" }, - "time": "2018-05-13T15:44:36+00:00", + "time": "2016-07-30T07:22:48+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -1218,29 +1283,24 @@ }, { "name": "symfony/css-selector", - "version": "v2.8.50", - "version_normalized": "2.8.50.0", + "version": "v3.4.46", + "version_normalized": "3.4.46.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "7b1692e418d7ccac24c373528453bc90e42797de" + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/7b1692e418d7ccac24c373528453bc90e42797de", - "reference": "7b1692e418d7ccac24c373528453bc90e42797de", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/da3d9da2ce0026771f5fe64cb332158f1bd2bc33", + "reference": "da3d9da2ce0026771f5fe64cb332158f1bd2bc33", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, - "time": "2018-11-11T11:18:13+00:00", + "time": "2020-10-24T10:57:07+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -1255,53 +1315,67 @@ "MIT" ], "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com" + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ] }, { "name": "symfony/debug", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "4a7330f29b3d215f8bacf076689f9d1c3d568681" + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/4a7330f29b3d215f8bacf076689f9d1c3d568681", - "reference": "4a7330f29b3d215f8bacf076689f9d1c3d568681", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.2", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2" + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" }, - "time": "2018-08-03T11:24:48+00:00", + "time": "2016-07-30T07:22:48+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -1332,36 +1406,32 @@ }, { "name": "symfony/dom-crawler", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.4.46", + "version_normalized": "3.4.46.0", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "d905e1c5885735ee66af60c205429b9941f24752" + "reference": "ef97bcfbae5b384b4ca6c8d57b617722f15241a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d905e1c5885735ee66af60c205429b9941f24752", - "reference": "d905e1c5885735ee66af60c205429b9941f24752", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/ef97bcfbae5b384b4ca6c8d57b617722f15241a6", + "reference": "ef97bcfbae5b384b4ca6c8d57b617722f15241a6", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.3" + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/css-selector": "" }, - "time": "2018-05-01T22:30:49+00:00", + "time": "2020-10-24T10:57:07+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -1386,44 +1456,57 @@ } ], "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com" + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ] }, { "name": "symfony/event-dispatcher", - "version": "v2.8.50", - "version_normalized": "2.8.50.0", + "version": "v3.4.46", + "version_normalized": "3.4.46.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + "reference": "31fde73757b6bad247c54597beef974919ec6860" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/31fde73757b6bad247c54597beef974919ec6860", + "reference": "31fde73757b6bad247c54597beef974919ec6860", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/debug": "~3.4|~4.4", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2018-11-21T14:20:20+00:00", + "time": "2020-10-24T10:57:07+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -1448,31 +1531,45 @@ } ], "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com" + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ] }, { "name": "symfony/finder", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "34226a3aa279f1e356ad56181b91acfdc9a2525c" + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/34226a3aa279f1e356ad56181b91acfdc9a2525c", - "reference": "34226a3aa279f1e356ad56181b91acfdc9a2525c", + "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, - "time": "2018-05-14T06:36:14+00:00", + "time": "2016-06-29T05:40:00+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -1503,31 +1600,31 @@ }, { "name": "symfony/http-foundation", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b67e5cbd2bf837fb3681f2c4965826d6c6758532" + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b67e5cbd2bf837fb3681f2c4965826d6c6758532", - "reference": "b67e5cbd2bf837fb3681f2c4965826d6c6758532", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82", + "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.4" + "symfony/expression-language": "~2.8|~3.0" }, - "time": "2019-04-16T09:58:21+00:00", + "time": "2016-07-17T13:54:30+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -1535,9 +1632,6 @@ "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" }, - "classmap": [ - "Resources/stubs" - ], "exclude-from-classmap": [ "/Tests/" ] @@ -1561,47 +1655,45 @@ }, { "name": "symfony/http-kernel", - "version": "v2.7.52", - "version_normalized": "2.7.52.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "435064b3b143f79469206915137c21e88b56bfb9" + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/435064b3b143f79469206915137c21e88b56bfb9", - "reference": "435064b3b143f79469206915137c21e88b56bfb9", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", + "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "psr/log": "~1.0", - "symfony/debug": "^2.6.2", - "symfony/event-dispatcher": "^2.6.7", - "symfony/http-foundation": "~2.7.36|^2.8.29", - "symfony/polyfill-ctype": "~1.8" + "symfony/debug": "~2.8|~3.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" }, "conflict": { - "symfony/config": "<2.7", - "twig/twig": "<1.34|<2.4,>=2" + "symfony/config": "<2.8" }, "require-dev": { - "symfony/browser-kit": "~2.3", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.7", - "symfony/console": "~2.3", - "symfony/css-selector": "^2.0.5", - "symfony/dependency-injection": "~2.2", - "symfony/dom-crawler": "^2.0.5", - "symfony/expression-language": "~2.4", - "symfony/finder": "^2.0.5", - "symfony/process": "^2.0.5", - "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.3", - "symfony/templating": "~2.2", - "symfony/translation": "^2.0.5", - "symfony/var-dumper": "~2.6" + "symfony/browser-kit": "~2.8|~3.0", + "symfony/class-loader": "~2.8|~3.0", + "symfony/config": "~2.8|~3.0", + "symfony/console": "~2.8|~3.0", + "symfony/css-selector": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/dom-crawler": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/finder": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0", + "symfony/routing": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0", + "symfony/templating": "~2.8|~3.0", + "symfony/translation": "~2.8|~3.0", + "symfony/var-dumper": "~2.8|~3.0" }, "suggest": { "symfony/browser-kit": "", @@ -1612,11 +1704,11 @@ "symfony/finder": "", "symfony/var-dumper": "" }, - "time": "2019-04-17T16:37:53+00:00", + "time": "2016-07-30T09:10:37+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -1647,30 +1739,34 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", - "version_normalized": "1.12.0.0", + "version": "v1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" }, - "time": "2019-08-06T08:03:45+00:00", + "time": "2020-10-23T14:02:19+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "installation-source": "dist", @@ -1703,34 +1799,52 @@ "ctype", "polyfill", "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ] }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", - "version_normalized": "1.12.0.0", + "version": "v1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2019-08-06T08:03:45+00:00", + "time": "2020-10-23T14:02:19+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "installation-source": "dist", @@ -1764,42 +1878,50 @@ "polyfill", "portable", "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } ] }, { "name": "symfony/polyfill-php56", - "version": "v1.12.0", - "version_normalized": "1.12.0.0", + "version": "v1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "0e3b212e96a51338639d8ce175c046d7729c3403" + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/0e3b212e96a51338639d8ce175c046d7729c3403", - "reference": "0e3b212e96a51338639d8ce175c046d7729c3403", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-util": "~1.0" + "php": ">=7.1" }, - "time": "2019-08-06T08:03:45+00:00", - "type": "library", + "time": "2020-10-23T14:02:19+00:00", + "type": "metapackage", "extra": { "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php56\\": "" + "dev-main": "1.20-dev" }, - "files": [ - "bootstrap.php" - ] + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1822,85 +1944,45 @@ "polyfill", "portable", "shim" - ] - }, - { - "name": "symfony/polyfill-util", - "version": "v1.12.0", - "version_normalized": "1.12.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-util.git", - "reference": "4317de1386717b4c22caed7725350a8887ab205c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/4317de1386717b4c22caed7725350a8887ab205c", - "reference": "4317de1386717b4c22caed7725350a8887ab205c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2019-08-06T08:03:45+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.12-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Util\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "authors": [ + "funding": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } - ], - "description": "Symfony utilities for portability of PHP codes", - "homepage": "https://symfony.com", - "keywords": [ - "compat", - "compatibility", - "polyfill", - "shim" ] }, { "name": "symfony/process", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "eda637e05670e2afeec3842dcd646dce94262f6b" + "reference": "768debc5996f599c4372b322d9061dba2a4bf505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/eda637e05670e2afeec3842dcd646dce94262f6b", - "reference": "eda637e05670e2afeec3842dcd646dce94262f6b", + "url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505", + "reference": "768debc5996f599c4372b322d9061dba2a4bf505", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, - "time": "2018-08-03T11:24:48+00:00", + "time": "2016-07-28T11:13:34+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -1931,46 +2013,47 @@ }, { "name": "symfony/routing", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "33bd5882f201f9a3b7dd9640b95710b71304c4fb" + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/33bd5882f201f9a3b7dd9640b95710b71304c4fb", - "reference": "33bd5882f201f9a3b7dd9640b95710b71304c4fb", + "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<2.8" }, "require-dev": { "doctrine/annotations": "~1.0", "doctrine/common": "~2.2", "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/expression-language": "~2.4", - "symfony/http-foundation": "~2.3", - "symfony/yaml": "^2.0.5" + "symfony/config": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/http-foundation": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "suggest": { "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" }, - "time": "2018-02-28T09:36:59+00:00", + "time": "2016-06-29T05:40:00+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -2007,41 +2090,42 @@ }, { "name": "symfony/translation", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "1959c78c5a32539ef221b3e18a961a96d949118f" + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/1959c78c5a32539ef221b3e18a961a96d949118f", - "reference": "1959c78c5a32539ef221b3e18a961a96d949118f", + "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", + "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<2.8" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.7", - "symfony/intl": "~2.7.25|^2.8.18", - "symfony/yaml": "~2.2" + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" }, "suggest": { - "psr/log-implementation": "To use logging capability in translator", + "psr/log": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, - "time": "2018-05-17T10:34:06+00:00", + "time": "2016-07-30T07:22:48+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -2072,33 +2156,34 @@ }, { "name": "symfony/var-dumper", - "version": "v2.7.51", - "version_normalized": "2.7.51.0", + "version": "v3.0.9", + "version_normalized": "3.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6f9271e94369db05807b261fcfefe4cd1aafd390" + "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6f9271e94369db05807b261fcfefe4cd1aafd390", - "reference": "6f9271e94369db05807b261fcfefe4cd1aafd390", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377", + "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "require-dev": { + "twig/twig": "~1.20|~2.0" }, "suggest": { "ext-symfony_debug": "" }, - "time": "2018-04-22T05:56:10+00:00", + "time": "2016-07-26T08:03:56+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "installation-source": "dist", @@ -2136,50 +2221,76 @@ }, { "name": "vlucas/phpdotenv", - "version": "v1.1.1", - "version_normalized": "1.1.1.0", + "version": "v2.6.6", + "version_normalized": "2.6.6.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa" + "reference": "e1d57f62db3db00d9139078cbedf262280701479" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa", - "reference": "0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/e1d57f62db3db00d9139078cbedf262280701479", + "reference": "e1d57f62db3db00d9139078cbedf262280701479", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^5.3.9 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.17" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-filter": "*", + "ext-pcre": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7.27" }, - "time": "2015-05-30T15:59:26+00:00", + "suggest": { + "ext-filter": "Required to use the boolean validator.", + "ext-pcre": "Required to use most of the library." + }, + "time": "2020-07-14T17:54:18+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, "installation-source": "dist", "autoload": { - "psr-0": { - "Dotenv": "src/" + "psr-4": { + "Dotenv\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "BSD-3-Clause" ], "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "homepage": "https://gjcampbell.co.uk/" + }, { "name": "Vance Lucas", "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" + "homepage": "https://vancelucas.com/" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "homepage": "http://github.com/vlucas/phpdotenv", "keywords": [ "dotenv", "env", "environment" + ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } ] } ] diff --git a/application/vendor/danielstjules/stringy/.gitignore b/application/vendor/danielstjules/stringy/.gitignore deleted file mode 100644 index 8db156e..0000000 --- a/application/vendor/danielstjules/stringy/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -.DS_Store diff --git a/application/vendor/danielstjules/stringy/.travis.yml b/application/vendor/danielstjules/stringy/.travis.yml deleted file mode 100644 index f7637c8..0000000 --- a/application/vendor/danielstjules/stringy/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: php -php: - - 5.6 - - 5.5 - - 5.4 - - 5.3 - - hhvm diff --git a/application/vendor/danielstjules/stringy/CHANGELOG.md b/application/vendor/danielstjules/stringy/CHANGELOG.md deleted file mode 100644 index 379c629..0000000 --- a/application/vendor/danielstjules/stringy/CHANGELOG.md +++ /dev/null @@ -1,119 +0,0 @@ -### 1.10.0 (2015-07-22) - - * Added trimLeft, trimRight - * Added support for unicode whitespace to trim - * Added delimit - * Added indexOf and indexOfLast - * Added htmlEncode and htmlDecode - * Added "Ç" in toAscii() - -### 1.9.0 (2015-02-09) - - * Added hasUpperCase and hasLowerCase - * Added $removeUnsupported parameter to toAscii() - * Improved toAscii support with additional Unicode spaces, Vietnamese chars, - and numerous other characters - * Separated the charsArray from toAscii as a protected method that may be - extended by inheriting classes - * Chars array is cached for better performance - -### 1.8.1 (2015-01-08) - - * Optimized chars() - * Added "ä Ä Ö Ü"" in toAscii() - * Added support for Unicode spaces in toAscii() - * Replaced instances of self::create() with static::create() - * Added missing test cases for safeTruncate() and longestCommonSuffix() - * Updated Stringy\create() to avoid collision when it already exists - -### 1.8.0 (2015-01-03) - - * Listed ext-mbstring in composer.json - * Added Stringy\create function for PHP 5.6 - -### 1.7.0 (2014-10-14) - - * Added containsAll and containsAny - * Light cleanup - -### 1.6.0 (2014-09-14) - - * Added toTitleCase - -### 1.5.2 (2014-07-09) - - * Announced support for HHVM - -### 1.5.1 (2014-04-19) - - * Fixed toAscii() failing to remove remaining non-ascii characters - * Updated slugify() to treat dash and underscore as delimiters by default - * Updated slugify() to remove leading and trailing delimiter, if present - -### 1.5.0 (2014-03-19) - - * Made both str and encoding protected, giving property access to subclasses - * Added getEncoding() - * Fixed isJSON() giving false negatives - * Cleaned up and simplified: replace(), collapseWhitespace(), underscored(), - dasherize(), pad(), padLeft(), padRight() and padBoth() - * Fixed handling consecutive invalid chars in slugify() - * Removed conflicting hard sign transliteration in toAscii() - -### 1.4.0 (2014-02-12) - - * Implemented the IteratorAggregate interface, added chars() - * Renamed count() to countSubstr() - * Updated count() to implement Countable interface - * Implemented the ArrayAccess interface with positive and negative indices - * Switched from PSR-0 to PSR-4 autoloading - -### 1.3.0 (2013-12-16) - - * Additional Bulgarian support for toAscii - * str property made private - * Constructor casts first argument to string - * Constructor throws an InvalidArgumentException when given an array - * Constructor throws an InvalidArgumentException when given an object without - a __toString method - -### 1.2.2 (2013-12-04) - - * Updated create function to use late static binding - * Added optional $replacement param to slugify - -### 1.2.1 (2013-10-11) - - * Cleaned up tests - * Added homepage to composer.json - -### 1.2.0 (2013-09-15) - - * Fixed pad's use of InvalidArgumentException - * Fixed replace(). It now correctly treats regex special chars as normal chars - * Added additional Cyrillic letters to toAscii - * Added $caseSensitive to contains() and count() - * Added toLowerCase() - * Added toUpperCase() - * Added regexReplace() - -### 1.1.0 (2013-08-31) - - * Fix for collapseWhitespace() - * Added isHexadecimal() - * Added constructor to Stringy\Stringy - * Added isSerialized() - * Added isJson() - -### 1.0.0 (2013-08-1) - - * 1.0.0 release - * Added test coverage for Stringy::create and method chaining - * Added tests for returned type - * Fixed StaticStringy::replace(). It was returning a Stringy object instead of string - * Renamed standardize() to the more appropriate toAscii() - * Cleaned up comments and README - -### 1.0.0-rc.1 (2013-07-28) - - * Release candidate diff --git a/application/vendor/danielstjules/stringy/LICENSE.txt b/application/vendor/danielstjules/stringy/LICENSE.txt deleted file mode 100644 index 0b70302..0000000 --- a/application/vendor/danielstjules/stringy/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013 Daniel St. Jules - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/application/vendor/danielstjules/stringy/README.md b/application/vendor/danielstjules/stringy/README.md deleted file mode 100644 index ab09bdc..0000000 --- a/application/vendor/danielstjules/stringy/README.md +++ /dev/null @@ -1,1190 +0,0 @@ -![Stringy](http://danielstjules.com/github/stringy-logo.png) - -A PHP string manipulation library with multibyte support. Offers both OO method -chaining and a procedural-style static wrapper. Tested and compatible with -PHP 5.3+ and HHVM. Inspired by underscore.string.js. - -[![Build Status](https://api.travis-ci.org/danielstjules/Stringy.svg?branch=master)](https://travis-ci.org/danielstjules/Stringy) - -* [Requiring/Loading](#requiringloading) -* [OO and Procedural](#oo-and-procedural) -* [Implemented Interfaces](#implemented-interfaces) -* [PHP 5.6 Creation](#php-56-creation) -* [Methods](#methods) - * [at](#at) - * [camelize](#camelize) - * [chars](#chars) - * [collapseWhitespace](#collapsewhitespace) - * [contains](#contains) - * [containsAll](#containsall) - * [containsAny](#containsany) - * [countSubstr](#countsubstr) - * [create](#create) - * [dasherize](#dasherize) - * [delimit](#delimit) - * [endsWith](#endswith) - * [ensureLeft](#ensureleft) - * [ensureRight](#ensureright) - * [first](#first) - * [getEncoding](#getencoding) - * [hasLowerCase](#haslowercase) - * [hasUpperCase](#hasuppercase) - * [htmlDecode](#htmldecode) - * [htmlEncode](#htmlencode) - * [humanize](#humanize) - * [indexOf](#indexof) - * [indexOfLast](#indexoflast) - * [insert](#insert) - * [isAlpha](#isalpha) - * [isAlphanumeric](#isalphanumeric) - * [isBlank](#isblank) - * [isHexadecimal](#ishexadecimal) - * [isJson](#isjson) - * [isLowerCase](#islowercase) - * [isSerialized](#isserialized) - * [isUpperCase](#isuppercase) - * [last](#last) - * [length](#length) - * [longestCommonPrefix](#longestcommonprefix) - * [longestCommonSuffix](#longestcommonsuffix) - * [longestCommonSubstring](#longestcommonsubstring) - * [lowerCaseFirst](#lowercasefirst) - * [pad](#pad) - * [padBoth](#padboth) - * [padLeft](#padleft) - * [padRight](#padright) - * [regexReplace](#regexreplace) - * [removeLeft](#removeleft) - * [removeRight](#removeright) - * [replace](#replace) - * [reverse](#reverse) - * [safeTruncate](#safetruncate) - * [shuffle](#shuffle) - * [slugify](#slugify) - * [startsWith](#startswith) - * [substr](#substr) - * [surround](#surround) - * [swapCase](#swapcase) - * [tidy](#tidy) - * [titleize](#titleize) - * [toAscii](#toascii) - * [toLowerCase](#tolowercase) - * [toSpaces](#tospaces) - * [toTabs](#totabs) - * [toTitleCase](#totitlecase) - * [toUpperCase](#touppercase) - * [trim](#trim) - * [trimLeft](#trimLeft) - * [trimRight](#trimRight) - * [truncate](#truncate) - * [underscored](#underscored) - * [upperCamelize](#uppercamelize) - * [upperCaseFirst](#uppercasefirst) -* [Links](#links) -* [Tests](#tests) -* [License](#license) - -## Requiring/Loading - -If you're using Composer to manage dependencies, you can include the following -in your composer.json file: - -```json -{ - "require": { - "danielstjules/stringy": "~1.10" - } -} -``` - -Then, after running `composer update` or `php composer.phar update`, you can -load the class using Composer's autoloading: - -```php -require 'vendor/autoload.php'; -``` - -Otherwise, you can simply require the file directly: - -```php -require_once 'path/to/Stringy/src/Stringy.php'; -// or -require_once 'path/to/Stringy/src/StaticStringy.php'; -``` - -And in either case, I'd suggest using an alias. - -```php -use Stringy\Stringy as S; -// or -use Stringy\StaticStringy as S; -``` - -## OO and Procedural - -The library offers both OO method chaining with `Stringy\Stringy`, as well as -procedural-style static method calls with `Stringy\StaticStringy`. An example -of the former is the following: - -```php -use Stringy\Stringy as S; -echo S::create('Fòô Bàř', 'UTF-8')->collapseWhitespace()->swapCase(); // 'fÒÔ bÀŘ' -``` - -`Stringy\Stringy` has a __toString() method, which returns the current string -when the object is used in a string context, ie: -`(string) S::create('foo') // 'foo'` - -Using the static wrapper, an alternative is the following: - -```php -use Stringy\StaticStringy as S; -$string = S::collapseWhitespace('Fòô Bàř', 'UTF-8'); -echo S::swapCase($string, 'UTF-8'); // 'fÒÔ bÀŘ' -``` - -## Implemented Interfaces - -`Stringy\Stringy` implements the `IteratorAggregate` interface, meaning that -`foreach` can be used with an instance of the class: - -``` php -$stringy = S::create('Fòô Bàř', 'UTF-8'); -foreach ($stringy as $char) { - echo $char; -} -// 'Fòô Bàř' -``` - -It implements the `Countable` interface, enabling the use of `count()` to -retrieve the number of characters in the string: - -``` php -$stringy = S::create('Fòô', 'UTF-8'); -count($stringy); // 3 -``` - -Furthermore, the `ArrayAccess` interface has been implemented. As a result, -`isset()` can be used to check if a character at a specific index exists. And -since `Stringy\Stringy` is immutable, any call to `offsetSet` or `offsetUnset` -will throw an exception. `offsetGet` has been implemented, however, and accepts -both positive and negative indexes. Invalid indexes result in an -`OutOfBoundsException`. - -``` php -$stringy = S::create('Bàř', 'UTF-8'); -echo $stringy[2]; // 'ř' -echo $stringy[-2]; // 'à' -isset($stringy[-4]); // false - -$stringy[3]; // OutOfBoundsException -$stringy[2] = 'a'; // Exception -``` - -## PHP 5.6 Creation - -As of PHP 5.6, [`use function`](https://wiki.php.net/rfc/use_function) is -available for importing functions. Stringy exposes a namespaced function, -`Stringy\create`, which emits the same behaviour as `Stringy\Stringy::create()`. -If running PHP 5.6, or another runtime that supports the `use function` syntax, -you can take advantage of an even simpler API as seen below: - -``` php -use function Stringy\create as s; - -// Instead of: S::create('Fòô Bàř', 'UTF-8') -s('Fòô Bàř', 'UTF-8')->collapseWhitespace()->swapCase(); -``` - -## Methods - -In the list below, any static method other than S::create refers to a method in -`Stringy\StaticStringy`. For all others, they're found in `Stringy\Stringy`. -Furthermore, all methods that return a Stringy object or string do not modify -the original. Stringy objects are immutable. - -*Note: If `$encoding` is not given, it defaults to `mb_internal_encoding()`.* - -#### at - -$stringy->at(int $index) - -S::at(int $index [, string $encoding ]) - -Returns the character at $index, with indexes starting at 0. - -```php -S::create('fòô bàř', 'UTF-8')->at(6); -S::at('fòô bàř', 6, 'UTF-8'); // 'ř' -``` - -#### camelize - -$stringy->camelize(); - -S::camelize(string $str [, string $encoding ]) - -Returns a camelCase version of the string. Trims surrounding spaces, -capitalizes letters following digits, spaces, dashes and underscores, -and removes spaces, dashes, as well as underscores. - -```php -S::create('Camel-Case')->camelize(); -S::camelize('Camel-Case'); // 'camelCase' -``` - -#### chars - -$stringy->chars(); - -S::chars(string $str [, string $encoding ]) - -Returns an array consisting of the characters in the string. - -```php -S::create('Fòô Bàř', 'UTF-8')->chars(); -S::chars('Fòô Bàř', 'UTF-8'); // array(F', 'ò', 'ô', ' ', 'B', 'à', 'ř') -``` - -#### collapseWhitespace - -$stringy->collapseWhitespace() - -S::collapseWhitespace(string $str [, string $encoding ]) - -Trims the string and replaces consecutive whitespace characters with a -single space. This includes tabs and newline characters, as well as -multibyte whitespace such as the thin space and ideographic space. - -```php -S::create(' Ο συγγραφέας ')->collapseWhitespace(); -S::collapseWhitespace(' Ο συγγραφέας '); // 'Ο συγγραφέας' -``` - -#### contains - -$stringy->contains(string $needle [, boolean $caseSensitive = true ]) - -S::contains(string $haystack, string $needle [, boolean $caseSensitive = true [, string $encoding ]]) - -Returns true if the string contains $needle, false otherwise. By default, -the comparison is case-sensitive, but can be made insensitive -by setting $caseSensitive to false. - -```php -S::create('Ο συγγραφέας είπε', 'UTF-8')->contains('συγγραφέας'); -S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8'); // true -``` - -#### containsAll - -$stringy->containsAll(array $needles [, boolean $caseSensitive = true ]) - -S::containsAll(string $haystack, array $needles [, boolean $caseSensitive = true [, string $encoding ]]) - -Returns true if the string contains all $needles, false otherwise. By -default the comparison is case-sensitive, but can be made insensitive by -setting $caseSensitive to false. - -```php -S::create('Str contains foo and bar')->containsAll(array('foo', 'bar')); -S::containsAll('Str contains foo and bar', array('foo', 'bar')); // true -``` - -#### containsAny - -$stringy->containsAny(array $needles [, boolean $caseSensitive = true ]) - -S::containsAny(string $haystack, array $needles [, boolean $caseSensitive = true [, string $encoding ]]) - -Returns true if the string contains any $needles, false otherwise. By -default the comparison is case-sensitive, but can be made insensitive by -setting $caseSensitive to false. - -```php -S::create('Str contains foo')->containsAny(array('foo', 'bar')); -S::containsAny('Str contains foo', array('foo', 'bar')); // true -``` - -#### countSubstr - -$stringy->countSubstr(string $substring [, boolean $caseSensitive = true ]) - -S::countSubstr(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]]) - -Returns the number of occurrences of $substring in the given string. -By default, the comparison is case-sensitive, but can be made insensitive -by setting $caseSensitive to false. - -```php -S::create('Ο συγγραφέας είπε', 'UTF-8')->countSubstr('α'); -S::countSubstr('Ο συγγραφέας είπε', 'α', 'UTF-8'); // 2 -``` - -#### create - -S::create(mixed $str [, $encoding ]) - -Creates a Stringy object and assigns both str and encoding properties -the supplied values. $str is cast to a string prior to assignment, and if -$encoding is not specified, it defaults to mb_internal_encoding(). It -then returns the initialized object. Throws an InvalidArgumentException -if the first argument is an array or object without a __toString method. - -```php -$stringy = S::create('fòô bàř', 'UTF-8'); // 'fòô bàř' -``` - -#### dasherize - -$stringy->dasherize(); - -S::dasherize(string $str [, string $encoding ]) - -Returns a lowercase and trimmed string separated by dashes. Dashes are -inserted before uppercase characters (with the exception of the first -character of the string), and in place of spaces as well as underscores. - -```php -S::create('TestDCase')->dasherize(); -S::dasherize('TestDCase'); // 'test-d-case' -``` - -#### delimit - -$stringy->delimit($delimiter); - -S::delimit(string $str [, string $delimiter, string $encoding ]) - -Returns a lowercase and trimmed string separated by the given delimiter. -Delimiters are inserted before uppercase characters (with the exception -of the first character of the string), and in place of spaces, dashes, -and underscores. Alpha delimiters are not converted to lowercase. - -```php -S::create('TestDCase')->delimit('>>'); -S::delimit('TestCase', '>>'); // 'test>>case' -``` - -#### endsWith - -$stringy->endsWith(string $substring [, boolean $caseSensitive = true ]) - -S::endsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]]) - -Returns true if the string ends with $substring, false otherwise. By -default, the comparison is case-sensitive, but can be made insensitive by -setting $caseSensitive to false. - -```php -S::create('FÒÔ bàřs', 'UTF-8')->endsWith('àřs', true); -S::endsWith('FÒÔ bàřs', 'àřs', true, 'UTF-8'); // true -``` - -#### ensureLeft - -$stringy->ensureLeft(string $substring) - -S::ensureLeft(string $substring [, string $encoding ]) - -Ensures that the string begins with $substring. If it doesn't, it's prepended. - -```php -S::create('foobar')->ensureLeft('http://'); -S::ensureLeft('foobar', 'http://'); // 'http://foobar' -``` - -#### ensureRight - -$stringy->ensureRight(string $substring) - -S::ensureRight(string $substring [, string $encoding ]) - -Ensures that the string begins with $substring. If it doesn't, it's appended. - -```php -S::create('foobar')->ensureRight('.com'); -S::ensureRight('foobar', '.com'); // 'foobar.com' -``` - -#### first - -$stringy->first(int $n) - -S::first(int $n [, string $encoding ]) - -Returns the first $n characters of the string. - -```php -S::create('fòô bàř', 'UTF-8')->first(3); -S::first('fòô bàř', 3, 'UTF-8'); // 'fòô' -``` - -#### getEncoding - -$stringy->getEncoding() - -Returns the encoding used by the Stringy object. - -```php -S::create('fòô bàř', 'UTF-8')->getEncoding(); // 'UTF-8' -``` - -#### hasLowerCase - -$stringy->hasLowerCase() - -S::hasLowerCase(string $str [, string $encoding ]) - -Returns true if the string contains a lower case char, false otherwise. - -```php -S::create('fòô bàř', 'UTF-8')->hasLowerCase(); -S::hasLowerCase('fòô bàř', 'UTF-8'); // true -``` - -#### hasUpperCase - -$stringy->hasUpperCase() - -S::hasUpperCase(string $str [, string $encoding ]) - -Returns true if the string contains an upper case char, false otherwise. - -```php -S::create('fòô bàř', 'UTF-8')->hasUpperCase(); -S::hasUpperCase('fòô bàř', 'UTF-8'); // false -``` - -#### htmlDecode - -$stringy->htmlDecode() - -S::htmlDecode(string $str [, int $flags, string $encoding ]) - -Convert all HTML entities to their applicable characters. - -```php -S::create('&')->htmlDecode(); -S::htmlDecode('&'); // '&' -``` - -#### htmlEncode - -$stringy->htmlEncode() - -S::htmlEncode(string $str [, int $flags, string $encoding ]) - -Convert all applicable characters to HTML entities. - -```php -S::create('&')->htmlEncode(); -S::htmlEncode('&'); // '&' -``` - -#### humanize - -$stringy->humanize() - -S::humanize(string $str [, string $encoding ]) - -Capitalizes the first word of the string, replaces underscores with -spaces, and strips '_id'. - -```php -S::create('author_id')->humanize(); -S::humanize('author_id'); // 'Author' -``` - -#### indexOf - -$stringy->indexOf(string $needle [, $offset = 0 ]); - -S::indexOf(string $haystack , string $needle [, $offset = 0 [, $encoding = null ]]) - -Returns the index of the first occurrence of $needle in the string, -and false if not found. Accepts an optional offset from which to begin -the search. - -```php -S::create('string', 'UTF-8')->indexOf('ing'); -S::indexOf('string', 'ing'); // 3 -``` - -#### indexOfLast - -$stringy->indexOfLast(string $needle [, $offset = 0 ]); - -S::indexOfLast(string $haystack , string $needle [, $offset = 0 [, $encoding = null ]]) - -Returns the index of the last occurrence of $needle in the string, -and false if not found. Accepts an optional offset from which to begin -the search. - -```php -S::create('string', 'UTF-8')->indexOfLast('ing'); -S::indexOfLast('string string', 'ing'); // 10 -``` - -#### insert - -$stringy->insert(int $index, string $substring) - -S::insert(string $str, int $index, string $substring [, string $encoding ]) - -Inserts $substring into the string at the $index provided. - -```php -S::create('fòô bà', 'UTF-8')->insert('ř', 6); -S::insert('fòô bà', 'ř', 6, 'UTF-8'); // 'fòô bàř' -``` - -#### isAlpha - -$stringy->isAlpha() - -S::isAlpha(string $str [, string $encoding ]) - -Returns true if the string contains only alphabetic chars, false otherwise. - -```php -S::create('丹尼爾', 'UTF-8')->isAlpha(); -S::isAlpha('丹尼爾', 'UTF-8'); // true -``` - -#### isAlphanumeric - -$stringy->isAlphanumeric() - -S::isAlphanumeric(string $str [, string $encoding ]) - -Returns true if the string contains only alphabetic and numeric chars, false -otherwise. - -```php -S::create('دانيال1', 'UTF-8')->isAlphanumeric(); -S::isAlphanumeric('دانيال1', 'UTF-8'); // true -``` - -#### isBlank - -$stringy->isBlank() - -S::isBlank(string $str [, string $encoding ]) - -Returns true if the string contains only whitespace chars, false otherwise. - -```php -S::create("\n\t \v\f")->isBlank(); -S::isBlank("\n\t \v\f"); // true -``` - -#### isHexadecimal - -$stringy->isHexadecimal() - -S::isHexadecimal(string $str [, string $encoding ]) - -Returns true if the string contains only hexadecimal chars, false otherwise. - -```php -S::create('A102F')->isHexadecimal(); -S::isHexadecimal('A102F'); // true -``` - -#### isJson - -$stringy->isJson() - -S::isJson(string $str [, string $encoding ]) - -Returns true if the string is JSON, false otherwise. - -```php -S::create('{"foo":"bar"}')->isJson(); -S::isJson('{"foo":"bar"}'); // true -``` - -#### isLowerCase - -$stringy->isLowerCase() - -S::isLowerCase(string $str [, string $encoding ]) - -Returns true if the string contains only lower case chars, false otherwise. - -```php -S::create('fòô bàř', 'UTF-8')->isLowerCase(); -S::isLowerCase('fòô bàř', 'UTF-8'); // true -``` - -#### isSerialized - -$stringy->isSerialized() - -S::isSerialized(string $str [, string $encoding ]) - -Returns true if the string is serialized, false otherwise. - -```php -S::create('a:1:{s:3:"foo";s:3:"bar";}', 'UTF-8')->isSerialized(); -S::isSerialized('a:1:{s:3:"foo";s:3:"bar";}', 'UTF-8'); // true -``` - -#### isUpperCase - -$stringy->isUpperCase() - -S::isUpperCase(string $str [, string $encoding ]) - -Returns true if the string contains only upper case chars, false otherwise. - -```php -S::create('FÒÔBÀŘ', 'UTF-8')->isUpperCase(); -S::isUpperCase('FÒÔBÀŘ', 'UTF-8'); // true -``` - -#### last - -$stringy->last(int $n) - -S::last(int $n [, string $encoding ]) - -Returns the last $n characters of the string. - -```php -S::create('fòô bàř', 'UTF-8')->last(3); -S::last('fòô bàř', 3, 'UTF-8'); // 'bàř' -``` - -#### length - -$stringy->length() - -S::length(string $str [, string $encoding ]) - -Returns the length of the string. An alias for PHP's mb_strlen() function. - -```php -S::create('fòô bàř', 'UTF-8')->length(); -S::length('fòô bàř', 'UTF-8'); // 7 -``` - -#### longestCommonPrefix - -$stringy->longestCommonPrefix(string $otherStr) - -S::longestCommonPrefix(string $str, string $otherStr [, $encoding ]) - -Returns the longest common prefix between the string and $otherStr. - -```php -S::create('fòô bar', 'UTF-8')->longestCommonPrefix('fòr bar'); -S::longestCommonPrefix('fòô bar', 'fòr bar', 'UTF-8'); // 'fò' -``` - -#### longestCommonSuffix - -$stringy->longestCommonSuffix(string $otherStr) - -S::longestCommonSuffix(string $str, string $otherStr [, $encoding ]) - -Returns the longest common suffix between the string and $otherStr. - -```php -S::create('fòô bàř', 'UTF-8')->longestCommonSuffix('fòr bàř'); -S::longestCommonSuffix('fòô bàř', 'fòr bàř', 'UTF-8'); // ' bàř' -``` - -#### longestCommonSubstring - -$stringy->longestCommonSubstring(string $otherStr) - -S::longestCommonSubstring(string $str, string $otherStr [, $encoding ]) - -Returns the longest common substring between the string and $otherStr. In the -case of ties, it returns that which occurs first. - -```php -S::create('foo bar')->longestCommonSubstring('boo far'); -S::longestCommonSubstring('foo bar', 'boo far'); // 'oo ' -``` - -#### lowerCaseFirst - -$stringy->lowerCaseFirst(); - -S::lowerCaseFirst(string $str [, string $encoding ]) - -Converts the first character of the supplied string to lower case. - -```php -S::create('Σ test', 'UTF-8')->lowerCaseFirst(); -S::lowerCaseFirst('Σ test', 'UTF-8'); // 'σ test' -``` - -#### pad - -$stringy->pad(int $length [, string $padStr = ' ' [, string $padType = 'right' ]]) - -S::pad(string $str , int $length [, string $padStr = ' ' [, string $padType = 'right' [, string $encoding ]]]) - -Pads the string to a given length with $padStr. If length is less than -or equal to the length of the string, no padding takes places. The default -string used for padding is a space, and the default type (one of 'left', -'right', 'both') is 'right'. Throws an InvalidArgumentException if -$padType isn't one of those 3 values. - -```php -S::create('fòô bàř', 'UTF-8')->pad( 10, '¬ø', 'left'); -S::pad('fòô bàř', 10, '¬ø', 'left', 'UTF-8'); // '¬ø¬fòô bàř' -``` - -#### padBoth - -$stringy->padBoth(int $length [, string $padStr = ' ' ]) - -S::padBoth(string $str , int $length [, string $padStr = ' ' [, string $encoding ]]) - -Returns a new string of a given length such that both sides of the string -string are padded. Alias for pad() with a $padType of 'both'. - -```php -S::create('foo bar')->padBoth(9, ' '); -S::padBoth('foo bar', 9, ' '); // ' foo bar ' -``` - -#### padLeft - -$stringy->padLeft(int $length [, string $padStr = ' ' ]) - -S::padLeft(string $str , int $length [, string $padStr = ' ' [, string $encoding ]]) - -Returns a new string of a given length such that the beginning of the -string is padded. Alias for pad() with a $padType of 'left'. - -```php -S::create($str, $encoding)->padLeft($length, $padStr); -S::padLeft('foo bar', 9, ' '); // ' foo bar' -``` - -#### padRight - -$stringy->padRight(int $length [, string $padStr = ' ' ]) - -S::padRight(string $str , int $length [, string $padStr = ' ' [, string $encoding ]]) - -Returns a new string of a given length such that the end of the string is -padded. Alias for pad() with a $padType of 'right'. - -```php -S::create('foo bar')->padRight(10, '_*'); -S::padRight('foo bar', 10, '_*'); // 'foo bar_*_' -``` - -#### regexReplace - -$stringy->regexReplace(string $pattern, string $replacement [, string $options = 'msr']) - -S::regexReplace(string $str, string $pattern, string $replacement [, string $options = 'msr' [, string $encoding ]]) - -Replaces all occurrences of $pattern in $str by $replacement. An alias -for mb_ereg_replace(). Note that the 'i' option with multibyte patterns -in mb_ereg_replace() requires PHP 5.4+. This is due to a lack of support -in the bundled version of Oniguruma in PHP 5.3. - -```php -S::create('fòô ', 'UTF-8')->regexReplace('f[òô]+\s', 'bàř', 'msr'); -S::regexReplace('fòô ', 'f[òô]+\s', 'bàř', 'msr', 'UTF-8'); // 'bàř' -``` - -#### removeLeft - -$stringy->removeLeft(string $substring) - -S::removeLeft(string $str, string $substring [, string $encoding ]) - -Returns a new string with the prefix $substring removed, if present. - -```php -S::create('fòô bàř', 'UTF-8')->removeLeft('fòô '); -S::removeLeft('fòô bàř', 'fòô ', 'UTF-8'); // 'bàř' -``` - -#### removeRight - -$stringy->removeRight(string $substring) - -S::removeRight(string $str, string $substring [, string $encoding ]) - -Returns a new string with the suffix $substring removed, if present. - -```php -S::create('fòô bàř', 'UTF-8')->removeRight(' bàř'); -S::removeRight('fòô bàř', ' bàř', 'UTF-8'); // 'fòô' -``` - -#### replace - -$stringy->replace(string $search, string $replacement) - -S::replace(string $str, string $search, string $replacement [, string $encoding ]) - -Replaces all occurrences of $search in $str by $replacement. - -```php -S::create('fòô bàř fòô bàř', 'UTF-8')->replace('fòô ', ''); -S::replace('fòô bàř fòô bàř', 'fòô ', '', 'UTF-8'); // 'bàř bàř' -``` - -#### reverse - -$stringy->reverse() - -S::reverse(string $str [, string $encoding ]) - -Returns a reversed string. A multibyte version of strrev(). - -```php -S::create('fòô bàř', 'UTF-8')->reverse(); -S::reverse('fòô bàř', 'UTF-8'); // 'řàb ôòf' -``` - -#### safeTruncate - -$stringy->safeTruncate(int $length [, string $substring = '' ]) - -S::safeTruncate(string $str, int $length [, string $substring = '' [, string $encoding ]]) - -Truncates the string to a given length, while ensuring that it does not -split words. If $substring is provided, and truncating occurs, the -string is further truncated so that the substring may be appended without -exceeding the desired length. - -```php -S::create('What are your plans today?')->safeTruncate(22, '...'); -S::safeTruncate('What are your plans today?', 22, '...'); // 'What are your plans...' -``` - -#### shuffle - -$stringy->shuffle() - -S::shuffle(string $str [, string $encoding ]) - -A multibyte str_shuffle() function. It returns a string with its characters in -random order. - -```php -S::create('fòô bàř', 'UTF-8')->shuffle(); -S::shuffle('fòô bàř', 'UTF-8'); // 'àôřb òf' -``` - -#### slugify - -$stringy->slugify([ string $replacement = '-' ]) - -S::slugify(string $str [, string $replacement = '-' ]) - -Converts the string into an URL slug. This includes replacing non-ASCII -characters with their closest ASCII equivalents, removing remaining -non-ASCII and non-alphanumeric characters, and replacing whitespace with -$replacement. The replacement defaults to a single dash, and the string -is also converted to lowercase. - -```php -S::create('Using strings like fòô bàř')->slugify(); -S::slugify('Using strings like fòô bàř'); // 'using-strings-like-foo-bar' -``` - -#### startsWith - -$stringy->startsWith(string $substring [, boolean $caseSensitive = true ]) - -S::startsWith(string $str, string $substring [, boolean $caseSensitive = true [, string $encoding ]]) - -Returns true if the string begins with $substring, false otherwise. -By default, the comparison is case-sensitive, but can be made insensitive -by setting $caseSensitive to false. - -```php -S::create('FÒÔ bàřs', 'UTF-8')->startsWith('fòô bàř', false); -S::startsWith('FÒÔ bàřs', 'fòô bàř', false, 'UTF-8'); // true -``` - -#### substr - -$stringy->substr(int $start [, int $length ]) - -S::substr(string $str, int $start [, int $length [, string $encoding ]]) - -Returns the substring beginning at $start with the specified $length. -It differs from the mb_substr() function in that providing a $length of -null will return the rest of the string, rather than an empty string. - -```php -S::create('fòô bàř', 'UTF-8')->substr(2, 3); -S::substr('fòô bàř', 2, 3, 'UTF-8'); // 'ô b' -``` - -#### surround - -$stringy->surround(string $substring) - -S::surround(string $str, string $substring) - -Surrounds a string with the given substring. - -```php -S::create(' ͜ ')->surround('ʘ'); -S::surround(' ͜ ', 'ʘ'); // 'ʘ ͜ ʘ' -``` - -#### swapCase - -$stringy->swapCase(); - -S::swapCase(string $str [, string $encoding ]) - -Returns a case swapped version of the string. - -```php -S::create('Ντανιλ', 'UTF-8')->swapCase(); -S::swapCase('Ντανιλ', 'UTF-8'); // 'νΤΑΝΙΛ' -``` - -#### tidy - -$stringy->tidy() - -S::tidy(string $str) - -Returns a string with smart quotes, ellipsis characters, and dashes from -Windows-1252 (commonly used in Word documents) replaced by their ASCII equivalents. - -```php -S::create('“I see…”')->tidy(); -S::tidy('“I see…”'); // '"I see..."' -``` - -#### titleize - -$stringy->titleize([ string $encoding ]) - -S::titleize(string $str [, array $ignore [, string $encoding ]]) - -Returns a trimmed string with the first letter of each word capitalized. -Ignores the case of other letters, preserving any acronyms. Also accepts -an array, $ignore, allowing you to list words not to be capitalized. - -```php -$ignore = array('at', 'by', 'for', 'in', 'of', 'on', 'out', 'to', 'the'); -S::create('i like to watch DVDs at home', 'UTF-8')->titleize($ignore); -S::titleize('i like to watch DVDs at home', $ignore, 'UTF-8'); -// 'I Like to Watch DVDs at Home' -``` - -#### toAscii - -$stringy->toAscii() - -S::toAscii(string $str [, boolean $removeUnsupported = true]) - -Returns an ASCII version of the string. A set of non-ASCII characters are -replaced with their closest ASCII counterparts, and the rest are removed -unless instructed otherwise. - -```php -S::create('fòô bàř')->toAscii(); -S::toAscii('fòô bàř'); // 'foo bar' -``` - -#### toLowerCase - -$stringy->toLowerCase() - -S::toLowerCase(string $str [, string $encoding ]) - -Converts all characters in the string to lowercase. An alias for PHP's -mb_strtolower(). - -```php -S::create('FÒÔ BÀŘ', 'UTF-8')->toLowerCase(); -S::toLowerCase('FÒÔ BÀŘ', 'UTF-8'); // 'fòô bàř' -``` - -#### toSpaces - -$stringy->toSpaces([ tabLength = 4 ]) - -S::toSpaces(string $str [, int $tabLength = 4 ]) - -Converts each tab in the string to some number of spaces, as defined by -$tabLength. By default, each tab is converted to 4 consecutive spaces. - -```php -S::create(' String speech = "Hi"')->toSpaces(); -S::toSpaces(' String speech = "Hi"'); // ' String speech = "Hi"' -``` - -#### toTabs - -$stringy->toTabs([ tabLength = 4 ]) - -S::toTabs(string $str [, int $tabLength = 4 ]) - -Converts each occurrence of some consecutive number of spaces, as defined -by $tabLength, to a tab. By default, each 4 consecutive spaces are -converted to a tab. - -```php -S::create(' fòô bàř')->toTabs(); -S::toTabs(' fòô bàř'); // ' fòô bàř' -``` - -#### toTitleCase - -$stringy->toTitleCase() - -S::toTitleCase(string $str [, string $encoding ]) - -Converts the first character of each word in the string to uppercase. - -```php -S::create('fòô bàř', 'UTF-8')->toTitleCase(); -S::toTitleCase('fòô bàř', 'UTF-8'); // 'Fòô Bàř' -``` - -#### toUpperCase - -$stringy->toUpperCase() - -S::toUpperCase(string $str [, string $encoding ]) - -Converts all characters in the string to uppercase. An alias for PHP's -mb_strtoupper(). - -```php -S::create('fòô bàř', 'UTF-8')->toUpperCase(); -S::toUpperCase('fòô bàř', 'UTF-8'); // 'FÒÔ BÀŘ' -``` - -#### trim - -$stringy->trim([, string $chars]) - -S::trim(string $str [, string $chars [, string $encoding ]]) - -Returns a string with whitespace removed from the start and end of the -string. Supports the removal of unicode whitespace. Accepts an optional -string of characters to strip instead of the defaults. - -```php -S::create(' fòô bàř ', 'UTF-8')->trim(); -S::trim(' fòô bàř '); // 'fòô bàř' -``` - -#### trimLeft - -$stringy->trimLeft([, string $chars]) - -S::trimLeft(string $str [, string $chars [, string $encoding ]]) - -Returns a string with whitespace removed from the start of the string. -Supports the removal of unicode whitespace. Accepts an optional -string of characters to strip instead of the defaults. - -```php -S::create(' fòô bàř ', 'UTF-8')->trimLeft(); -S::trimLeft(' fòô bàř '); // 'fòô bàř ' -``` - -#### trimRight - -$stringy->trimRight([, string $chars]) - -S::trimRight(string $str [, string $chars [, string $encoding ]]) - -Returns a string with whitespace removed from the end of the string. -Supports the removal of unicode whitespace. Accepts an optional -string of characters to strip instead of the defaults. - -```php -S::create(' fòô bàř ', 'UTF-8')->trimRight(); -S::trimRight(' fòô bàř '); // ' fòô bàř' -``` - -#### truncate - -$stringy->truncate(int $length [, string $substring = '' ]) - -S::truncate(string $str, int $length [, string $substring = '' [, string $encoding ]]) - -Truncates the string to a given length. If $substring is provided, and -truncating occurs, the string is further truncated so that the substring -may be appended without exceeding the desired length. - -```php -S::create('What are your plans today?')->truncate(19, '...'); -S::truncate('What are your plans today?', 19, '...'); // 'What are your pl...' -``` - -#### underscored - -$stringy->underscored(); - -S::underscored(string $str [, string $encoding ]) - -Returns a lowercase and trimmed string separated by underscores. -Underscores are inserted before uppercase characters (with the exception -of the first character of the string), and in place of spaces as well as dashes. - -```php -S::create('TestUCase')->underscored(); -S::underscored('TestUCase'); // 'test_u_case' -``` - -#### upperCamelize - -$stringy->upperCamelize(); - -S::upperCamelize(string $str [, string $encoding ]) - -Returns an UpperCamelCase version of the supplied string. It trims -surrounding spaces, capitalizes letters following digits, spaces, dashes -and underscores, and removes spaces, dashes, underscores. - -```php -S::create('Upper Camel-Case')->upperCamelize(); -S::upperCamelize('Upper Camel-Case'); // 'UpperCamelCase' -``` - -#### upperCaseFirst - -$stringy->upperCaseFirst(); - -S::upperCaseFirst(string $str [, string $encoding ]) - -Converts the first character of the supplied string to upper case. - -```php -S::create('σ test', 'UTF-8')->upperCaseFirst(); -S::upperCaseFirst('σ test', 'UTF-8'); // 'Σ test' -``` - -## Links - -The following is a list of libraries that extend Stringy: - - * [SliceableStringy](https://github.com/danielstjules/SliceableStringy): -Python-like string slices in PHP - * [SubStringy](https://github.com/TCB13/SubStringy): -Advanced substring methods - -## Tests - -From the project directory, tests can be ran using `phpunit` - -## License - -Released under the MIT License - see `LICENSE.txt` for details. diff --git a/application/vendor/danielstjules/stringy/composer.json b/application/vendor/danielstjules/stringy/composer.json deleted file mode 100644 index f71f252..0000000 --- a/application/vendor/danielstjules/stringy/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "danielstjules/stringy", - "description": "A string manipulation library with multibyte support", - "keywords": [ - "multibyte", "string", "manipulation", "utility", "methods", "utf-8", - "helpers", "utils", "utf" - ], - "homepage": "https://github.com/danielstjules/Stringy", - "license": "MIT", - "authors": [ - { - "name": "Daniel St. Jules", - "email": "danielst.jules@gmail.com", - "homepage": "http://www.danielstjules.com" - } - ], - "require": { - "php": ">=5.3.0", - "ext-mbstring": "*" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "support": { - "issues": "https://github.com/danielstjules/Stringy/issues", - "source": "https://github.com/danielstjules/Stringy" - }, - "autoload": { - "psr-4": { "Stringy\\": "src/" }, - "files": ["src/Create.php"] - }, - "autoload-dev": { - "classmap": [ "tests" ] - } -} diff --git a/application/vendor/danielstjules/stringy/phpunit.xml.dist b/application/vendor/danielstjules/stringy/phpunit.xml.dist deleted file mode 100644 index 987dbbf..0000000 --- a/application/vendor/danielstjules/stringy/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - tests/CommonTest.php - tests/StringyTest.php - tests/StaticStringyTest.php - tests/CreateTest.php - - - diff --git a/application/vendor/danielstjules/stringy/src/Create.php b/application/vendor/danielstjules/stringy/src/Create.php deleted file mode 100644 index c6a2f44..0000000 --- a/application/vendor/danielstjules/stringy/src/Create.php +++ /dev/null @@ -1,19 +0,0 @@ -chars(); - } - - /** - * Converts the first character of the supplied string to upper case. - * - * @param string $str String to modify - * @param string $encoding The character encoding - * @return string String with the first character being upper case - */ - public static function upperCaseFirst($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->upperCaseFirst(); - } - - /** - * Converts the first character of the supplied string to lower case. - * - * @param string $str String to modify - * @param string $encoding The character encoding - * @return string String with the first character being lower case - */ - public static function lowerCaseFirst($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->lowerCaseFirst(); - } - - /** - * Returns a camelCase version of the string. Trims surrounding spaces, - * capitalizes letters following digits, spaces, dashes and underscores, - * and removes spaces, dashes, as well as underscores. - * - * @param string $str String to convert to camelCase - * @param string $encoding The character encoding - * @return string String in camelCase - */ - public static function camelize($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->camelize(); - } - - /** - * Returns an UpperCamelCase version of the supplied string. It trims - * surrounding spaces, capitalizes letters following digits, spaces, dashes - * and underscores, and removes spaces, dashes, underscores. - * - * @param string $str String to convert to UpperCamelCase - * @param string $encoding The character encoding - * @return string String in UpperCamelCase - */ - public static function upperCamelize($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->upperCamelize(); - } - - /** - * Returns a lowercase and trimmed string separated by dashes. Dashes are - * inserted before uppercase characters (with the exception of the first - * character of the string), and in place of spaces as well as underscores. - * - * @param string $str String to convert - * @param string $encoding The character encoding - * @return string Dasherized string - */ - public static function dasherize($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->dasherize(); - } - - /** - * Returns a lowercase and trimmed string separated by underscores. - * Underscores are inserted before uppercase characters (with the exception - * of the first character of the string), and in place of spaces as well as - * dashes. - * - * @param string $str String to convert - * @param string $encoding The character encoding - * @return string Underscored string - */ - public static function underscored($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->underscored(); - } - - /** - * Returns a lowercase and trimmed string separated by the given delimiter. - * Delimiters are inserted before uppercase characters (with the exception - * of the first character of the string), and in place of spaces, dashes, - * and underscores. Alpha delimiters are not converted to lowercase. - * - * @param string $str String to convert - * @param string $delimiter Sequence used to separate parts of the string - * @param string $encoding The character encoding - * @return string String with delimiter - */ - public static function delimit($str, $delimiter, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->delimit($delimiter); - } - - /** - * Returns a case swapped version of the string. - * - * @param string $str String to swap case - * @param string $encoding The character encoding - * @return string String with each character's case swapped - */ - public static function swapCase($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->swapCase(); - } - - /** - * Returns a trimmed string with the first letter of each word capitalized. - * Ignores the case of other letters, preserving any acronyms. Also accepts - * an array, $ignore, allowing you to list words not to be capitalized. - * - * @param string $str String to titleize - * @param string $encoding The character encoding - * @param array $ignore An array of words not to capitalize - * @return string Titleized string - */ - public static function titleize($str, $ignore = null, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->titleize($ignore); - } - - /** - * Capitalizes the first word of the string, replaces underscores with - * spaces, and strips '_id'. - * - * @param string $str String to humanize - * @param string $encoding The character encoding - * @return string A humanized string - */ - public static function humanize($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->humanize(); - } - - /** - * Returns a string with smart quotes, ellipsis characters, and dashes from - * Windows-1252 (commonly used in Word documents) replaced by their ASCII - * equivalents. - * - * @param string $str String to remove special chars - * @return string String with those characters removed - */ - public static function tidy($str) - { - return (string) Stringy::create($str)->tidy(); - } - - /** - * Trims the string and replaces consecutive whitespace characters with a - * single space. This includes tabs and newline characters, as well as - * multibyte whitespace such as the thin space and ideographic space. - * - * @param string $str The string to cleanup whitespace - * @param string $encoding The character encoding - * @return string The trimmed string with condensed whitespace - */ - public static function collapseWhitespace($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->collapseWhitespace(); - } - - /** - * Returns an ASCII version of the string. A set of non-ASCII characters are - * replaced with their closest ASCII counterparts, and the rest are removed - * unless instructed otherwise. - * - * @param string $str A string with non-ASCII characters - * @param bool $removeUnsupported Whether or not to remove the - * unsupported characters - * @return string A string containing only ASCII characters - */ - public static function toAscii($str, $removeUnsupported = true) - { - return (string) Stringy::create($str)->toAscii($removeUnsupported); - } - - /** - * Pads the string to a given length with $padStr. If length is less than - * or equal to the length of the string, no padding takes places. The - * default string used for padding is a space, and the default type (one of - * 'left', 'right', 'both') is 'right'. Throws an InvalidArgumentException - * if $padType isn't one of those 3 values. - * - * @param string $str String to pad - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @param string $padType One of 'left', 'right', 'both' - * @param string $encoding The character encoding - * @return string The padded string - * @throws \InvalidArgumentException If $padType isn't one of 'right', - * 'left' or 'both' - */ - public static function pad($str, $length, $padStr = ' ', $padType = 'right', - $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->pad($length, $padStr, $padType); - } - - /** - * Returns a new string of a given length such that the beginning of the - * string is padded. Alias for pad() with a $padType of 'left'. - * - * @param string $str String to pad - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @param string $encoding The character encoding - * @return string The padded string - */ - public static function padLeft($str, $length, $padStr = ' ', $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->padLeft($length, $padStr); - } - - /** - * Returns a new string of a given length such that the end of the string - * is padded. Alias for pad() with a $padType of 'right'. - * - * @param string $str String to pad - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @param string $encoding The character encoding - * @return string The padded string - */ - public static function padRight($str, $length, $padStr = ' ', $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->padRight($length, $padStr); - } - - /** - * Returns a new string of a given length such that both sides of the - * string are padded. Alias for pad() with a $padType of 'both'. - * - * @param string $str String to pad - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @param string $encoding The character encoding - * @return string The padded string - */ - public static function padBoth($str, $length, $padStr = ' ', $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->padBoth($length, $padStr); - } - - /** - * Returns true if the string begins with $substring, false otherwise. By - * default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $str String to check the start of - * @param string $substring The substring to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @param string $encoding The character encoding - * @return bool Whether or not $str starts with $substring - */ - public static function startsWith($str, $substring, $caseSensitive = true, - $encoding = null) - { - return Stringy::create($str, $encoding) - ->startsWith($substring, $caseSensitive); - } - - /** - * Returns true if the string ends with $substring, false otherwise. By - * default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $str String to check the end of - * @param string $substring The substring to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @param string $encoding The character encoding - * @return bool Whether or not $str ends with $substring - */ - public static function endsWith($str, $substring, $caseSensitive = true, - $encoding = null) - { - return Stringy::create($str, $encoding) - ->endsWith($substring, $caseSensitive); - } - - /** - * Converts each tab in the string to some number of spaces, as defined by - * $tabLength. By default, each tab is converted to 4 consecutive spaces. - * - * @param string $str String to convert tabs to spaces - * @param int $tabLength Number of spaces to replace each tab with - * @return string String with tabs switched to spaces - */ - public static function toSpaces($str, $tabLength = 4) - { - return (string) Stringy::create($str)->toSpaces($tabLength); - } - - /** - * Converts each occurrence of some consecutive number of spaces, as - * defined by $tabLength, to a tab. By default, each 4 consecutive spaces - * are converted to a tab. - * - * @param string $str String to convert spaces to tabs - * @param int $tabLength Number of spaces to replace with a tab - * @return string String with spaces switched to tabs - */ - public static function toTabs($str, $tabLength = 4) - { - return (string) Stringy::create($str)->toTabs($tabLength); - } - - /** - * Converts all characters in the string to lowercase. An alias for PHP's - * mb_strtolower(). - * - * @param string $str String to convert case - * @param string $encoding The character encoding - * @return string The lowercase string - */ - public static function toLowerCase($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->toLowerCase(); - } - - /** - * Converts the first character of each word in the string to uppercase. - * - * @param string $str String to convert case - * @param string $encoding The character encoding - * @return string The title-cased string - */ - public static function toTitleCase($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->toTitleCase(); - } - - /** - * Converts all characters in the string to uppercase. An alias for PHP's - * mb_strtoupper(). - * - * @param string $str String to convert case - * @param string $encoding The character encoding - * @return string The uppercase string - */ - public static function toUpperCase($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->toUpperCase(); - } - - /** - * Converts the string into an URL slug. This includes replacing non-ASCII - * characters with their closest ASCII equivalents, removing remaining - * non-ASCII and non-alphanumeric characters, and replacing whitespace with - * $replacement. The replacement defaults to a single dash, and the string - * is also converted to lowercase. - * - * @param string $str Text to transform into an URL slug - * @param string $replacement The string used to replace whitespace - * @return string The corresponding URL slug - */ - public static function slugify($str, $replacement = '-') - { - return (string) Stringy::create($str)->slugify($replacement); - } - - /** - * Returns true if the string contains $needle, false otherwise. By default, - * the comparison is case-sensitive, but can be made insensitive by setting - * $caseSensitive to false. - * - * @param string $haystack String being checked - * @param string $needle Substring to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @param string $encoding The character encoding - * @return bool Whether or not $haystack contains $needle - */ - public static function contains($haystack, $needle, $caseSensitive = true, - $encoding = null) - { - return Stringy::create($haystack, $encoding) - ->contains($needle, $caseSensitive); - } - - /** - * Returns true if the string contains any $needles, false otherwise. By - * default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $haystack String being checked - * @param array $needles Substrings to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @param string $encoding The character encoding - * @return bool Whether or not $haystack contains any $needles - */ - public static function containsAny($haystack, $needles, - $caseSensitive = true, $encoding = null) - { - return Stringy::create($haystack, $encoding) - ->containsAny($needles, $caseSensitive); - } - - /** - * Returns true if the string contains all $needles, false otherwise. By - * default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $haystack String being checked - * @param array $needles Substrings to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @param string $encoding The character encoding - * @return bool Whether or not $haystack contains all $needles - */ - public static function containsAll($haystack, $needles, - $caseSensitive = true, $encoding = null) - { - return Stringy::create($haystack, $encoding) - ->containsAll($needles, $caseSensitive); - } - - /** - * Returns the index of the first occurrence of $needle in the string, - * and false if not found. Accepts an optional offset from which to begin - * the search. - * - * @param string $haystack String to search - * @param string $needle Substring to look for - * @param int $offset Offset from which to search - * @return int|bool The occurrence's index if found, otherwise false - */ - public static function indexOf($haystack, $needle, $offset = 0, - $encoding = null) - { - return Stringy::create($haystack, $encoding) - ->indexOf($needle, $offset); - } - - /** - * Returns the index of the last occurrence of $needle in the string, - * and false if not found. Accepts an optional offset from which to begin - * the search. - * - * @param string $haystack String to search - * @param string $needle Substring to look for - * @param int $offset Offset from which to search - * @return int|bool The last occurrence's index if found, otherwise false - */ - public static function indexOfLast($haystack, $needle, $offset = 0, - $encoding = null) - { - return Stringy::create($haystack, $encoding) - ->indexOfLast($needle, $offset); - } - - /** - * Surrounds a string with the given substring. - * - * @param string $str The string to surround - * @param string $substring The substring to add to both sides - * @return string The string with the substring prepended and appended - */ - public static function surround($str, $substring) - { - return (string) Stringy::create($str)->surround($substring); - } - - /** - * Inserts $substring into the string at the $index provided. - * - * @param string $str String to insert into - * @param string $substring String to be inserted - * @param int $index The index at which to insert the substring - * @param string $encoding The character encoding - * @return string The resulting string after the insertion - */ - public static function insert($str, $substring, $index, $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->insert($substring, $index); - } - - /** - * Truncates the string to a given length. If $substring is provided, and - * truncating occurs, the string is further truncated so that the substring - * may be appended without exceeding the desired length. - * - * @param string $str String to truncate - * @param int $length Desired length of the truncated string - * @param string $substring The substring to append if it can fit - * @param string $encoding The character encoding - * @return string The resulting string after truncating - */ - public static function truncate($str, $length, $substring = '', - $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->truncate($length, $substring); - } - - /** - * Truncates the string to a given length, while ensuring that it does not - * split words. If $substring is provided, and truncating occurs, the - * string is further truncated so that the substring may be appended without - * exceeding the desired length. - * - * @param string $str String to truncate - * @param int $length Desired length of the truncated string - * @param string $substring The substring to append if it can fit - * @param string $encoding The character encoding - * @return string The resulting string after truncating - */ - public static function safeTruncate($str, $length, $substring = '', - $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->safeTruncate($length, $substring); - } - - /** - * Returns a reversed string. A multibyte version of strrev(). - * - * @param string $str String to reverse - * @param string $encoding The character encoding - * @return string The reversed string - */ - public static function reverse($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->reverse(); - } - - /** - * A multibyte str_shuffle() function. It returns a string with its - * characters in random order. - * - * @param string $str String to shuffle - * @param string $encoding The character encoding - * @return string The shuffled string - */ - public static function shuffle($str, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->shuffle(); - } - - /** - * Returns a string with whitespace removed from the start and end of the - * string. Supports the removal of unicode whitespace. Accepts an optional - * string of characters to strip instead of the defaults. - * - * @param string $str String to trim - * @param string $chars Optional string of characters to strip - * @param string $encoding The character encoding - * @return string Trimmed $str - */ - public static function trim($str, $chars = null, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->trim($chars); - } - - /** - * Returns a string with whitespace removed from the start of the string. - * Supports the removal of unicode whitespace. Accepts an optional - * string of characters to strip instead of the defaults. - * - * @param string $str String to trim - * @param string $chars Optional string of characters to strip - * @param string $encoding The character encoding - * @return string Trimmed $str - */ - public static function trimLeft($str, $chars = null, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->trimLeft($chars); - } - - /** - * Returns a string with whitespace removed from the end of the string. - * Supports the removal of unicode whitespace. Accepts an optional - * string of characters to strip instead of the defaults. - * - * @param string $str String to trim - * @param string $chars Optional string of characters to strip - * @param string $encoding The character encoding - * @return string Trimmed $str - */ - public static function trimRight($str, $chars = null, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->trimRight($chars); - } - - /** - * Returns the longest common prefix between the string and $otherStr. - * - * @param string $str First string for comparison - * @param string $otherStr Second string for comparison - * @param string $encoding The character encoding - * @return string The longest common prefix - */ - public static function longestCommonPrefix($str, $otherStr, $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->longestCommonPrefix($otherStr); - } - - /** - * Returns the longest common suffix between the string and $otherStr. - * - * @param string $str First string for comparison - * @param string $otherStr Second string for comparison - * @param string $encoding The character encoding - * @return string The longest common suffix - */ - public static function longestCommonSuffix($str, $otherStr, $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->longestCommonSuffix($otherStr); - } - - /** - * Returns the longest common substring between the string and $otherStr. - * In the case of ties, it returns that which occurs first. - * - * @param string $str First string for comparison - * @param string $otherStr Second string for comparison - * @param string $encoding The character encoding - * @return string The longest common substring - */ - public static function longestCommonSubstring($str, $otherStr, - $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->longestCommonSubstring($otherStr); - } - - /** - * Returns the length of the string. An alias for PHP's mb_strlen() function. - * - * @param string $str The string to get the length of - * @param string $encoding The character encoding - * @return int The number of characters in $str given the encoding - */ - public static function length($str, $encoding = null) - { - return Stringy::create($str, $encoding)->length(); - } - - /** - * Returns the substring beginning at $start with the specified $length. - * It differs from the mb_substr() function in that providing a $length of - * null will return the rest of the string, rather than an empty string. - * - * @param string $str The string to get the length of - * @param int $start Position of the first character to use - * @param int $length Maximum number of characters used - * @param string $encoding The character encoding - * @return string The substring of $str - */ - public static function substr($str, $start, $length = null, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->substr($start, $length); - } - - /** - * Returns the character at $index, with indexes starting at 0. - * - * @param string $str The string from which to get the char - * @param int $index Position of the character - * @param string $encoding The character encoding - * @return string The character at $index - */ - public static function at($str, $index, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->at($index); - } - - /** - * Returns the first $n characters of the string. - * - * @param string $str The string from which to get the substring - * @param int $n Number of chars to retrieve from the start - * @param string $encoding The character encoding - * @return string The first $n characters - */ - public static function first($str, $n, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->first($n); - } - - /** - * Returns the last $n characters of the string. - * - * @param string $str The string from which to get the substring - * @param int $n Number of chars to retrieve from the end - * @param string $encoding The character encoding - * @return string The last $n characters - */ - public static function last($str, $n, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->last($n); - } - - /** - * Ensures that the string begins with $substring. If it doesn't, it's - * prepended. - * - * @param string $str The string to modify - * @param string $substring The substring to add if not present - * @param string $encoding The character encoding - * @return string The string prefixed by the $substring - */ - public static function ensureLeft($str, $substring, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->ensureLeft($substring); - } - - /** - * Ensures that the string begins with $substring. If it doesn't, it's - * appended. - * - * @param string $str The string to modify - * @param string $substring The substring to add if not present - * @param string $encoding The character encoding - * @return string The string suffixed by the $substring - */ - public static function ensureRight($str, $substring, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->ensureRight($substring); - } - - /** - * Returns a new string with the prefix $substring removed, if present. - * - * @param string $str String from which to remove the prefix - * @param string $substring The prefix to remove - * @param string $encoding The character encoding - * @return string The string without the prefix $substring - */ - public static function removeLeft($str, $substring, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->removeLeft($substring); - } - - /** - * Returns a new string with the suffix $substring removed, if present. - * - * @param string $str String from which to remove the suffix - * @param string $substring The suffix to remove - * @param string $encoding The character encoding - * @return string The string without the suffix $substring - */ - public static function removeRight($str, $substring, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->removeRight($substring); - } - - /** - * Returns true if the string contains a lower case char, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains a lower case character. - */ - public static function hasLowerCase($str, $encoding = null) - { - return Stringy::create($str, $encoding)->hasLowerCase(); - } - - /** - * Returns true if the string contains an upper case char, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains an upper case character. - */ - public static function hasUpperCase($str, $encoding = null) - { - return Stringy::create($str, $encoding)->hasUpperCase(); - } - - /** - * Returns true if the string contains only alphabetic chars, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains only alphabetic chars - */ - public static function isAlpha($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isAlpha(); - } - - /** - * Returns true if the string contains only alphabetic and numeric chars, - * false otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains only alphanumeric chars - */ - public static function isAlphanumeric($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isAlphanumeric(); - } - - /** - * Returns true if the string contains only whitespace chars, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains only whitespace characters - */ - public static function isBlank($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isBlank(); - } - - /** - * Returns true if the string is JSON, false otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str is JSON - */ - public static function isJson($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isJson(); - } - - /** - * Returns true if the string contains only lower case chars, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains only lower case characters - */ - public static function isLowerCase($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isLowerCase(); - } - - /** - * Returns true if the string is serialized, false otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str is serialized - */ - public static function isSerialized($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isSerialized(); - } - - /** - * Returns true if the string contains only upper case chars, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains only upper case characters - */ - public static function isUpperCase($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isUpperCase(); - } - - /** - * Returns true if the string contains only hexadecimal chars, false - * otherwise. - * - * @param string $str String to check - * @param string $encoding The character encoding - * @return bool Whether or not $str contains only hexadecimal characters - */ - public static function isHexadecimal($str, $encoding = null) - { - return Stringy::create($str, $encoding)->isHexadecimal(); - } - - /** - * Returns the number of occurrences of $substring in the given string. - * By default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $str The string to search through - * @param string $substring The substring to search for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @param string $encoding The character encoding - * @return int The number of $substring occurrences - */ - public static function countSubstr($str, $substring, $caseSensitive = true, - $encoding = null) - { - return Stringy::create($str, $encoding) - ->countSubstr($substring, $caseSensitive); - } - - /** - * Replaces all occurrences of $search in $str by $replacement. - * - * @param string $str The haystack to search through - * @param string $search The needle to search for - * @param string $replacement The string to replace with - * @param string $encoding The character encoding - * @return string The resulting string after the replacements - */ - public static function replace($str, $search, $replacement, $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->replace($search, $replacement); - } - - /** - * Replaces all occurrences of $pattern in $str by $replacement. An alias - * for mb_ereg_replace(). Note that the 'i' option with multibyte patterns - * in mb_ereg_replace() requires PHP 5.4+. This is due to a lack of support - * in the bundled version of Oniguruma in PHP 5.3. - * - * @param string $str The haystack to search through - * @param string $pattern The regular expression pattern - * @param string $replacement The string to replace with - * @param string $options Matching conditions to be used - * @param string $encoding The character encoding - * @return string The resulting string after the replacements - */ - public static function regexReplace($str, $pattern, $replacement, - $options = 'msr', $encoding = null) - { - return (string) Stringy::create($str, $encoding) - ->regexReplace($pattern, $replacement, $options, $encoding); - } - - /** - * Convert all applicable characters to HTML entities. - * - * @param string $str The string to encode. - * @param int|null $flags See http://php.net/manual/en/function.htmlentities.php - * @param string $encoding The character encoding - * @return Stringy Object with the resulting $str after being html encoded. - */ - public static function htmlEncode($str, $flags = ENT_COMPAT, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->htmlEncode($flags); - } - - /** - * Convert all HTML entities to their applicable characters. - * - * @param string $str The string to decode. - * @param int|null $flags See http://php.net/manual/en/function.html-entity-decode.php - * @param string $encoding The character encoding - * @return Stringy Object with the resulting $str after being html decoded. - */ - public static function htmlDecode($str, $flags = ENT_COMPAT, $encoding = null) - { - return (string) Stringy::create($str, $encoding)->htmlDecode($flags); - } -} diff --git a/application/vendor/danielstjules/stringy/src/Stringy.php b/application/vendor/danielstjules/stringy/src/Stringy.php deleted file mode 100644 index 60b0694..0000000 --- a/application/vendor/danielstjules/stringy/src/Stringy.php +++ /dev/null @@ -1,1558 +0,0 @@ -str = (string) $str; - $this->encoding = $encoding ?: mb_internal_encoding(); - } - - /** - * Creates a Stringy object and assigns both str and encoding properties - * the supplied values. $str is cast to a string prior to assignment, and if - * $encoding is not specified, it defaults to mb_internal_encoding(). It - * then returns the initialized object. Throws an InvalidArgumentException - * if the first argument is an array or object without a __toString method. - * - * @param mixed $str Value to modify, after being cast to string - * @param string $encoding The character encoding - * @return Stringy A Stringy object - * @throws \InvalidArgumentException if an array or object without a - * __toString method is passed as the first argument - */ - public static function create($str, $encoding = null) - { - return new static($str, $encoding); - } - - /** - * Returns the value in $str. - * - * @return string The current value of the $str property - */ - public function __toString() - { - return $this->str; - } - - /** - * Returns the encoding used by the Stringy object. - * - * @return string The current value of the $encoding property - */ - public function getEncoding() - { - return $this->encoding; - } - - /** - * Returns the length of the string, implementing the countable interface. - * - * @return int The number of characters in the string, given the encoding - */ - public function count() - { - return $this->length(); - } - - /** - * Returns a new ArrayIterator, thus implementing the IteratorAggregate - * interface. The ArrayIterator's constructor is passed an array of chars - * in the multibyte string. This enables the use of foreach with instances - * of Stringy\Stringy. - * - * @return \ArrayIterator An iterator for the characters in the string - */ - public function getIterator() - { - return new \ArrayIterator($this->chars()); - } - - /** - * Returns whether or not a character exists at an index. Offsets may be - * negative to count from the last character in the string. Implements - * part of the ArrayAccess interface. - * - * @param mixed $offset The index to check - * @return boolean Whether or not the index exists - */ - public function offsetExists($offset) - { - $length = $this->length(); - $offset = (int) $offset; - - if ($offset >= 0) { - return ($length > $offset); - } - - return ($length >= abs($offset)); - } - - /** - * Returns the character at the given index. Offsets may be negative to - * count from the last character in the string. Implements part of the - * ArrayAccess interface, and throws an OutOfBoundsException if the index - * does not exist. - * - * @param mixed $offset The index from which to retrieve the char - * @return mixed The character at the specified index - * @throws \OutOfBoundsException If the positive or negative offset does - * not exist - */ - public function offsetGet($offset) - { - $offset = (int) $offset; - $length = $this->length(); - - if (($offset >= 0 && $length <= $offset) || $length < abs($offset)) { - throw new \OutOfBoundsException('No character exists at the index'); - } - - return mb_substr($this->str, $offset, 1, $this->encoding); - } - - /** - * Implements part of the ArrayAccess interface, but throws an exception - * when called. This maintains the immutability of Stringy objects. - * - * @param mixed $offset The index of the character - * @param mixed $value Value to set - * @throws \Exception When called - */ - public function offsetSet($offset, $value) - { - // Stringy is immutable, cannot directly set char - throw new \Exception('Stringy object is immutable, cannot modify char'); - } - - /** - * Implements part of the ArrayAccess interface, but throws an exception - * when called. This maintains the immutability of Stringy objects. - * - * @param mixed $offset The index of the character - * @throws \Exception When called - */ - public function offsetUnset($offset) - { - // Don't allow directly modifying the string - throw new \Exception('Stringy object is immutable, cannot unset char'); - } - - /** - * Returns an array consisting of the characters in the string. - * - * @return array An array of string chars - */ - public function chars() - { - $chars = array(); - for ($i = 0, $l = $this->length(); $i < $l; $i++) { - $chars[] = $this->at($i)->str; - } - - return $chars; - } - - /** - * Converts the first character of the supplied string to upper case. - * - * @return Stringy Object with the first character of $str being upper case - */ - public function upperCaseFirst() - { - $first = mb_substr($this->str, 0, 1, $this->encoding); - $rest = mb_substr($this->str, 1, $this->length() - 1, - $this->encoding); - - $str = mb_strtoupper($first, $this->encoding) . $rest; - - return static::create($str, $this->encoding); - } - - /** - * Converts the first character of the string to lower case. - * - * @return Stringy Object with the first character of $str being lower case - */ - public function lowerCaseFirst() - { - $first = mb_substr($this->str, 0, 1, $this->encoding); - $rest = mb_substr($this->str, 1, $this->length() - 1, - $this->encoding); - - $str = mb_strtolower($first, $this->encoding) . $rest; - - return static::create($str, $this->encoding); - } - - /** - * Returns a camelCase version of the string. Trims surrounding spaces, - * capitalizes letters following digits, spaces, dashes and underscores, - * and removes spaces, dashes, as well as underscores. - * - * @return Stringy Object with $str in camelCase - */ - public function camelize() - { - $encoding = $this->encoding; - $stringy = $this->trim()->lowerCaseFirst(); - - $camelCase = preg_replace_callback( - '/[-_\s]+(.)?/u', - function ($match) use ($encoding) { - return $match[1] ? mb_strtoupper($match[1], $encoding) : ''; - }, - $stringy->str - ); - - $stringy->str = preg_replace_callback( - '/[\d]+(.)?/u', - function ($match) use ($encoding) { - return mb_strtoupper($match[0], $encoding); - }, - $camelCase - ); - - return $stringy; - } - - /** - * Returns an UpperCamelCase version of the supplied string. It trims - * surrounding spaces, capitalizes letters following digits, spaces, dashes - * and underscores, and removes spaces, dashes, underscores. - * - * @return Stringy Object with $str in UpperCamelCase - */ - public function upperCamelize() - { - return $this->camelize()->upperCaseFirst(); - } - - /** - * Returns a lowercase and trimmed string separated by dashes. Dashes are - * inserted before uppercase characters (with the exception of the first - * character of the string), and in place of spaces as well as underscores. - * - * @return Stringy Object with a dasherized $str - */ - public function dasherize() - { - return $this->delimit('-'); - } - - /** - * Returns a lowercase and trimmed string separated by underscores. - * Underscores are inserted before uppercase characters (with the exception - * of the first character of the string), and in place of spaces as well as - * dashes. - * - * @return Stringy Object with an underscored $str - */ - public function underscored() - { - return $this->delimit('_'); - } - - /** - * Returns a lowercase and trimmed string separated by the given delimiter. - * Delimiters are inserted before uppercase characters (with the exception - * of the first character of the string), and in place of spaces, dashes, - * and underscores. Alpha delimiters are not converted to lowercase. - * - * @param string $delimiter Sequence used to separate parts of the string - * @return Stringy Object with a delimited $str - */ - public function delimit($delimiter) - { - // Save current regex encoding so we can reset it after - $regexEncoding = mb_regex_encoding(); - mb_regex_encoding($this->encoding); - - $str = mb_ereg_replace('\B([A-Z])', '-\1', $this->trim()); - $str = mb_strtolower($str, $this->encoding); - $str = mb_ereg_replace('[-_\s]+', $delimiter, $str); - - mb_regex_encoding($regexEncoding); - - return static::create($str, $this->encoding); - } - - /** - * Returns a case swapped version of the string. - * - * @return Stringy Object whose $str has each character's case swapped - */ - public function swapCase() - { - $stringy = static::create($this->str, $this->encoding); - $encoding = $stringy->encoding; - - $stringy->str = preg_replace_callback( - '/[\S]/u', - function ($match) use ($encoding) { - if ($match[0] == mb_strtoupper($match[0], $encoding)) { - return mb_strtolower($match[0], $encoding); - } else { - return mb_strtoupper($match[0], $encoding); - } - }, - $stringy->str - ); - - return $stringy; - } - - /** - * Returns a trimmed string with the first letter of each word capitalized. - * Ignores the case of other letters, preserving any acronyms. Also accepts - * an array, $ignore, allowing you to list words not to be capitalized. - * - * @param array $ignore An array of words not to capitalize - * @return Stringy Object with a titleized $str - */ - public function titleize($ignore = null) - { - $buffer = $this->trim(); - $encoding = $this->encoding; - - $buffer = preg_replace_callback( - '/([\S]+)/u', - function ($match) use ($encoding, $ignore) { - if ($ignore && in_array($match[0], $ignore)) { - return $match[0]; - } else { - $stringy = new Stringy($match[0], $encoding); - return (string) $stringy->upperCaseFirst(); - } - }, - $buffer - ); - - return new Stringy($buffer, $encoding); - } - - /** - * Capitalizes the first word of the string, replaces underscores with - * spaces, and strips '_id'. - * - * @return Stringy Object with a humanized $str - */ - public function humanize() - { - $str = str_replace(array('_id', '_'), array('', ' '), $this->str); - - return static::create($str, $this->encoding)->trim()->upperCaseFirst(); - } - - /** - * Returns a string with smart quotes, ellipsis characters, and dashes from - * Windows-1252 (commonly used in Word documents) replaced by their ASCII - * equivalents. - * - * @return Stringy Object whose $str has those characters removed - */ - public function tidy() - { - $str = preg_replace(array( - '/\x{2026}/u', - '/[\x{201C}\x{201D}]/u', - '/[\x{2018}\x{2019}]/u', - '/[\x{2013}\x{2014}]/u', - ), array( - '...', - '"', - "'", - '-', - ), $this->str); - - return static::create($str, $this->encoding); - } - - /** - * Trims the string and replaces consecutive whitespace characters with a - * single space. This includes tabs and newline characters, as well as - * multibyte whitespace such as the thin space and ideographic space. - * - * @return Stringy Object with a trimmed $str and condensed whitespace - */ - public function collapseWhitespace() - { - return $this->regexReplace('[[:space:]]+', ' ')->trim(); - } - - /** - * Returns an ASCII version of the string. A set of non-ASCII characters are - * replaced with their closest ASCII counterparts, and the rest are removed - * unless instructed otherwise. - * - * @param bool $removeUnsupported Whether or not to remove the - * unsupported characters - * @return Stringy Object whose $str contains only ASCII characters - */ - public function toAscii($removeUnsupported = true) - { - $str = $this->str; - - foreach ($this->charsArray() as $key => $value) { - $str = str_replace($value, $key, $str); - } - - if ($removeUnsupported) { - $str = preg_replace('/[^\x20-\x7E]/u', '', $str); - } - - return static::create($str, $this->encoding); - } - - /** - * Returns the replacements for the toAscii() method. - * - * @return array An array of replacements. - */ - protected function charsArray() - { - static $charsArray; - if (isset($charsArray)) return $charsArray; - - return $charsArray = array( - 'a' => array( - 'à', 'á', 'ả', 'ã', 'ạ', 'ă', 'ắ', 'ằ', 'ẳ', 'ẵ', - 'ặ', 'â', 'ấ', 'ầ', 'ẩ', 'ẫ', 'ậ', 'ä', 'ā', 'ą', - 'å', 'α', 'ά', 'ἀ', 'ἁ', 'ἂ', 'ἃ', 'ἄ', 'ἅ', 'ἆ', - 'ἇ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ὰ', - 'ά', 'ᾰ', 'ᾱ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'а', 'أ'), - 'b' => array('б', 'β', 'Ъ', 'Ь', 'ب'), - 'c' => array('ç', 'ć', 'č', 'ĉ', 'ċ'), - 'd' => array('ď', 'ð', 'đ', 'ƌ', 'ȡ', 'ɖ', 'ɗ', 'ᵭ', 'ᶁ', 'ᶑ', - 'д', 'δ', 'د', 'ض'), - 'e' => array('é', 'è', 'ẻ', 'ẽ', 'ẹ', 'ê', 'ế', 'ề', 'ể', 'ễ', - 'ệ', 'ë', 'ē', 'ę', 'ě', 'ĕ', 'ė', 'ε', 'έ', 'ἐ', - 'ἑ', 'ἒ', 'ἓ', 'ἔ', 'ἕ', 'ὲ', 'έ', 'е', 'ё', 'э', - 'є', 'ə'), - 'f' => array('ф', 'φ', 'ف'), - 'g' => array('ĝ', 'ğ', 'ġ', 'ģ', 'г', 'ґ', 'γ', 'ج'), - 'h' => array('ĥ', 'ħ', 'η', 'ή', 'ح', 'ه'), - 'i' => array('í', 'ì', 'ỉ', 'ĩ', 'ị', 'î', 'ï', 'ī', 'ĭ', 'į', - 'ı', 'ι', 'ί', 'ϊ', 'ΐ', 'ἰ', 'ἱ', 'ἲ', 'ἳ', 'ἴ', - 'ἵ', 'ἶ', 'ἷ', 'ὶ', 'ί', 'ῐ', 'ῑ', 'ῒ', 'ΐ', 'ῖ', - 'ῗ', 'і', 'ї', 'и'), - 'j' => array('ĵ', 'ј', 'Ј'), - 'k' => array('ķ', 'ĸ', 'к', 'κ', 'Ķ', 'ق', 'ك'), - 'l' => array('ł', 'ľ', 'ĺ', 'ļ', 'ŀ', 'л', 'λ', 'ل'), - 'm' => array('м', 'μ', 'م'), - 'n' => array('ñ', 'ń', 'ň', 'ņ', 'ʼn', 'ŋ', 'ν', 'н', 'ن'), - 'o' => array('ó', 'ò', 'ỏ', 'õ', 'ọ', 'ô', 'ố', 'ồ', 'ổ', 'ỗ', - 'ộ', 'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'ø', 'ō', 'ő', - 'ŏ', 'ο', 'ὀ', 'ὁ', 'ὂ', 'ὃ', 'ὄ', 'ὅ', 'ὸ', 'ό', - 'ö', 'о', 'و', 'θ'), - 'p' => array('п', 'π'), - 'r' => array('ŕ', 'ř', 'ŗ', 'р', 'ρ', 'ر'), - 's' => array('ś', 'š', 'ş', 'с', 'σ', 'ș', 'ς', 'س', 'ص'), - 't' => array('ť', 'ţ', 'т', 'τ', 'ț', 'ت', 'ط'), - 'u' => array('ú', 'ù', 'ủ', 'ũ', 'ụ', 'ư', 'ứ', 'ừ', 'ử', 'ữ', - 'ự', 'ü', 'û', 'ū', 'ů', 'ű', 'ŭ', 'ų', 'µ', 'у'), - 'v' => array('в'), - 'w' => array('ŵ', 'ω', 'ώ'), - 'x' => array('χ'), - 'y' => array('ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ', 'ÿ', 'ŷ', 'й', 'ы', 'υ', - 'ϋ', 'ύ', 'ΰ', 'ي'), - 'z' => array('ź', 'ž', 'ż', 'з', 'ζ', 'ز'), - 'aa' => array('ع'), - 'ae' => array('æ'), - 'ch' => array('ч'), - 'dj' => array('ђ', 'đ'), - 'dz' => array('џ'), - 'gh' => array('غ'), - 'kh' => array('х', 'خ'), - 'lj' => array('љ'), - 'nj' => array('њ'), - 'oe' => array('œ'), - 'ps' => array('ψ'), - 'sh' => array('ш'), - 'shch' => array('щ'), - 'ss' => array('ß'), - 'th' => array('þ', 'ث', 'ذ', 'ظ'), - 'ts' => array('ц'), - 'ya' => array('я'), - 'yu' => array('ю'), - 'zh' => array('ж'), - '(c)' => array('©'), - 'A' => array('Á', 'À', 'Ả', 'Ã', 'Ạ', 'Ă', 'Ắ', 'Ằ', 'Ẳ', 'Ẵ', - 'Ặ', 'Â', 'Ấ', 'Ầ', 'Ẩ', 'Ẫ', 'Ậ', 'Ä', 'Å', 'Ā', - 'Ą', 'Α', 'Ά', 'Ἀ', 'Ἁ', 'Ἂ', 'Ἃ', 'Ἄ', 'Ἅ', 'Ἆ', - 'Ἇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'Ᾰ', - 'Ᾱ', 'Ὰ', 'Ά', 'ᾼ', 'А'), - 'B' => array('Б', 'Β'), - 'C' => array('Ç','Ć', 'Č', 'Ĉ', 'Ċ'), - 'D' => array('Ď', 'Ð', 'Đ', 'Ɖ', 'Ɗ', 'Ƌ', 'ᴅ', 'ᴆ', 'Д', 'Δ'), - 'E' => array('É', 'È', 'Ẻ', 'Ẽ', 'Ẹ', 'Ê', 'Ế', 'Ề', 'Ể', 'Ễ', - 'Ệ', 'Ë', 'Ē', 'Ę', 'Ě', 'Ĕ', 'Ė', 'Ε', 'Έ', 'Ἐ', - 'Ἑ', 'Ἒ', 'Ἓ', 'Ἔ', 'Ἕ', 'Έ', 'Ὲ', 'Е', 'Ё', 'Э', - 'Є', 'Ə'), - 'F' => array('Ф', 'Φ'), - 'G' => array('Ğ', 'Ġ', 'Ģ', 'Г', 'Ґ', 'Γ'), - 'H' => array('Η', 'Ή'), - 'I' => array('Í', 'Ì', 'Ỉ', 'Ĩ', 'Ị', 'Î', 'Ï', 'Ī', 'Ĭ', 'Į', - 'İ', 'Ι', 'Ί', 'Ϊ', 'Ἰ', 'Ἱ', 'Ἳ', 'Ἴ', 'Ἵ', 'Ἶ', - 'Ἷ', 'Ῐ', 'Ῑ', 'Ὶ', 'Ί', 'И', 'І', 'Ї'), - 'K' => array('К', 'Κ'), - 'L' => array('Ĺ', 'Ł', 'Л', 'Λ', 'Ļ'), - 'M' => array('М', 'Μ'), - 'N' => array('Ń', 'Ñ', 'Ň', 'Ņ', 'Ŋ', 'Н', 'Ν'), - 'O' => array('Ó', 'Ò', 'Ỏ', 'Õ', 'Ọ', 'Ô', 'Ố', 'Ồ', 'Ổ', 'Ỗ', - 'Ộ', 'Ơ', 'Ớ', 'Ờ', 'Ở', 'Ỡ', 'Ợ', 'Ö', 'Ø', 'Ō', - 'Ő', 'Ŏ', 'Ο', 'Ό', 'Ὀ', 'Ὁ', 'Ὂ', 'Ὃ', 'Ὄ', 'Ὅ', - 'Ὸ', 'Ό', 'О', 'Θ', 'Ө'), - 'P' => array('П', 'Π'), - 'R' => array('Ř', 'Ŕ', 'Р', 'Ρ'), - 'S' => array('Ş', 'Ŝ', 'Ș', 'Š', 'Ś', 'С', 'Σ'), - 'T' => array('Ť', 'Ţ', 'Ŧ', 'Ț', 'Т', 'Τ'), - 'U' => array('Ú', 'Ù', 'Ủ', 'Ũ', 'Ụ', 'Ư', 'Ứ', 'Ừ', 'Ử', 'Ữ', - 'Ự', 'Û', 'Ü', 'Ū', 'Ů', 'Ű', 'Ŭ', 'Ų', 'У'), - 'V' => array('В'), - 'W' => array('Ω', 'Ώ'), - 'X' => array('Χ'), - 'Y' => array('Ý', 'Ỳ', 'Ỷ', 'Ỹ', 'Ỵ', 'Ÿ', 'Ῠ', 'Ῡ', 'Ὺ', 'Ύ', - 'Ы', 'Й', 'Υ', 'Ϋ'), - 'Z' => array('Ź', 'Ž', 'Ż', 'З', 'Ζ'), - 'AE' => array('Æ'), - 'CH' => array('Ч'), - 'DJ' => array('Ђ'), - 'DZ' => array('Џ'), - 'KH' => array('Х'), - 'LJ' => array('Љ'), - 'NJ' => array('Њ'), - 'PS' => array('Ψ'), - 'SH' => array('Ш'), - 'SHCH' => array('Щ'), - 'SS' => array('ẞ'), - 'TH' => array('Þ'), - 'TS' => array('Ц'), - 'YA' => array('Я'), - 'YU' => array('Ю'), - 'ZH' => array('Ж'), - ' ' => array("\xC2\xA0", "\xE2\x80\x80", "\xE2\x80\x81", - "\xE2\x80\x82", "\xE2\x80\x83", "\xE2\x80\x84", - "\xE2\x80\x85", "\xE2\x80\x86", "\xE2\x80\x87", - "\xE2\x80\x88", "\xE2\x80\x89", "\xE2\x80\x8A", - "\xE2\x80\xAF", "\xE2\x81\x9F", "\xE3\x80\x80"), - ); - } - - /** - * Pads the string to a given length with $padStr. If length is less than - * or equal to the length of the string, no padding takes places. The - * default string used for padding is a space, and the default type (one of - * 'left', 'right', 'both') is 'right'. Throws an InvalidArgumentException - * if $padType isn't one of those 3 values. - * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @param string $padType One of 'left', 'right', 'both' - * @return Stringy Object with a padded $str - * @throws InvalidArgumentException If $padType isn't one of 'right', - * 'left' or 'both' - */ - public function pad($length, $padStr = ' ', $padType = 'right') - { - if (!in_array($padType, array('left', 'right', 'both'))) { - throw new \InvalidArgumentException('Pad expects $padType ' . - "to be one of 'left', 'right' or 'both'"); - } - - switch ($padType) { - case 'left': - return $this->padLeft($length, $padStr); - case 'right': - return $this->padRight($length, $padStr); - default: - return $this->padBoth($length, $padStr); - } - } - - /** - * Returns a new string of a given length such that the beginning of the - * string is padded. Alias for pad() with a $padType of 'left'. - * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @return Stringy String with left padding - */ - public function padLeft($length, $padStr = ' ') - { - return $this->applyPadding($length - $this->length(), 0, $padStr); - } - - /** - * Returns a new string of a given length such that the end of the string - * is padded. Alias for pad() with a $padType of 'right'. - * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @return Stringy String with right padding - */ - public function padRight($length, $padStr = ' ') - { - return $this->applyPadding(0, $length - $this->length(), $padStr); - } - - /** - * Returns a new string of a given length such that both sides of the - * string are padded. Alias for pad() with a $padType of 'both'. - * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space - * @return Stringy String with padding applied - */ - public function padBoth($length, $padStr = ' ') - { - $padding = $length - $this->length(); - - return $this->applyPadding(floor($padding / 2), ceil($padding / 2), - $padStr); - } - - /** - * Adds the specified amount of left and right padding to the given string. - * The default character used is a space. - * - * @param int $left Length of left padding - * @param int $right Length of right padding - * @param string $padStr String used to pad - * @return Stringy String with padding applied - */ - private function applyPadding($left = 0, $right = 0, $padStr = ' ') - { - $stringy = static::create($this->str, $this->encoding); - $length = mb_strlen($padStr, $stringy->encoding); - - $strLength = $stringy->length(); - $paddedLength = $strLength + $left + $right; - - if (!$length || $paddedLength <= $strLength) { - return $stringy; - } - - $leftPadding = mb_substr(str_repeat($padStr, ceil($left / $length)), 0, - $left, $stringy->encoding); - $rightPadding = mb_substr(str_repeat($padStr, ceil($right / $length)), - 0, $right, $stringy->encoding); - - $stringy->str = $leftPadding . $stringy->str . $rightPadding; - - return $stringy; - } - - /** - * Returns true if the string begins with $substring, false otherwise. By - * default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $substring The substring to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @return bool Whether or not $str starts with $substring - */ - public function startsWith($substring, $caseSensitive = true) - { - $substringLength = mb_strlen($substring, $this->encoding); - $startOfStr = mb_substr($this->str, 0, $substringLength, - $this->encoding); - - if (!$caseSensitive) { - $substring = mb_strtolower($substring, $this->encoding); - $startOfStr = mb_strtolower($startOfStr, $this->encoding); - } - - return (string) $substring === $startOfStr; - } - - /** - * Returns true if the string ends with $substring, false otherwise. By - * default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $substring The substring to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @return bool Whether or not $str ends with $substring - */ - public function endsWith($substring, $caseSensitive = true) - { - $substringLength = mb_strlen($substring, $this->encoding); - $strLength = $this->length(); - - $endOfStr = mb_substr($this->str, $strLength - $substringLength, - $substringLength, $this->encoding); - - if (!$caseSensitive) { - $substring = mb_strtolower($substring, $this->encoding); - $endOfStr = mb_strtolower($endOfStr, $this->encoding); - } - - return (string) $substring === $endOfStr; - } - - /** - * Converts each tab in the string to some number of spaces, as defined by - * $tabLength. By default, each tab is converted to 4 consecutive spaces. - * - * @param int $tabLength Number of spaces to replace each tab with - * @return Stringy Object whose $str has had tabs switched to spaces - */ - public function toSpaces($tabLength = 4) - { - $spaces = str_repeat(' ', $tabLength); - $str = str_replace("\t", $spaces, $this->str); - - return static::create($str, $this->encoding); - } - - /** - * Converts each occurrence of some consecutive number of spaces, as - * defined by $tabLength, to a tab. By default, each 4 consecutive spaces - * are converted to a tab. - * - * @param int $tabLength Number of spaces to replace with a tab - * @return Stringy Object whose $str has had spaces switched to tabs - */ - public function toTabs($tabLength = 4) - { - $spaces = str_repeat(' ', $tabLength); - $str = str_replace($spaces, "\t", $this->str); - - return static::create($str, $this->encoding); - } - - /** - * Converts the first character of each word in the string to uppercase. - * - * @return Stringy Object with all characters of $str being title-cased - */ - public function toTitleCase() - { - $str = mb_convert_case($this->str, MB_CASE_TITLE, $this->encoding); - - return static::create($str, $this->encoding); - } - - /** - * Converts all characters in the string to lowercase. An alias for PHP's - * mb_strtolower(). - * - * @return Stringy Object with all characters of $str being lowercase - */ - public function toLowerCase() - { - $str = mb_strtolower($this->str, $this->encoding); - - return static::create($str, $this->encoding); - } - - /** - * Converts all characters in the string to uppercase. An alias for PHP's - * mb_strtoupper(). - * - * @return Stringy Object with all characters of $str being uppercase - */ - public function toUpperCase() - { - $str = mb_strtoupper($this->str, $this->encoding); - - return static::create($str, $this->encoding); - } - - /** - * Converts the string into an URL slug. This includes replacing non-ASCII - * characters with their closest ASCII equivalents, removing remaining - * non-ASCII and non-alphanumeric characters, and replacing whitespace with - * $replacement. The replacement defaults to a single dash, and the string - * is also converted to lowercase. - * - * @param string $replacement The string used to replace whitespace - * @return Stringy Object whose $str has been converted to an URL slug - */ - public function slugify($replacement = '-') - { - $stringy = $this->toAscii(); - - $quotedReplacement = preg_quote($replacement); - $pattern = "/[^a-zA-Z\d\s-_$quotedReplacement]/u"; - $stringy->str = preg_replace($pattern, '', $stringy); - - return $stringy->toLowerCase()->delimit($replacement) - ->removeLeft($replacement)->removeRight($replacement); - } - - /** - * Returns true if the string contains $needle, false otherwise. By default - * the comparison is case-sensitive, but can be made insensitive by setting - * $caseSensitive to false. - * - * @param string $needle Substring to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @return bool Whether or not $str contains $needle - */ - public function contains($needle, $caseSensitive = true) - { - $encoding = $this->encoding; - - if ($caseSensitive) { - return (mb_strpos($this->str, $needle, 0, $encoding) !== false); - } else { - return (mb_stripos($this->str, $needle, 0, $encoding) !== false); - } - } - - /** - * Returns true if the string contains any $needles, false otherwise. By - * default the comparison is case-sensitive, but can be made insensitive by - * setting $caseSensitive to false. - * - * @param array $needles Substrings to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @return bool Whether or not $str contains $needle - */ - public function containsAny($needles, $caseSensitive = true) - { - if (empty($needles)) { - return false; - } - - foreach ($needles as $needle) { - if ($this->contains($needle, $caseSensitive)) { - return true; - } - } - - return false; - } - - /** - * Returns true if the string contains all $needles, false otherwise. By - * default the comparison is case-sensitive, but can be made insensitive by - * setting $caseSensitive to false. - * - * @param array $needles Substrings to look for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @return bool Whether or not $str contains $needle - */ - public function containsAll($needles, $caseSensitive = true) - { - if (empty($needles)) { - return false; - } - - foreach ($needles as $needle) { - if (!$this->contains($needle, $caseSensitive)) { - return false; - } - } - - return true; - } - - /** - * Returns the index of the first occurrence of $needle in the string, - * and false if not found. Accepts an optional offset from which to begin - * the search. - * - * @param string $needle Substring to look for - * @param int $offset Offset from which to search - * @return int|bool The occurrence's index if found, otherwise false - */ - public function indexOf($needle, $offset = 0) - { - return mb_strpos($this->str, (string) $needle, - (int) $offset, $this->encoding); - } - - /** - * Returns the index of the last occurrence of $needle in the string, - * and false if not found. Accepts an optional offset from which to begin - * the search. - * - * @param string $needle Substring to look for - * @param int $offset Offset from which to search - * @return int|bool The last occurrence's index if found, otherwise false - */ - public function indexOfLast($needle, $offset = 0) - { - return mb_strrpos($this->str, (string) $needle, - (int) $offset, $this->encoding); - } - - /** - * Surrounds $str with the given substring. - * - * @param string $substring The substring to add to both sides - * @return Stringy Object whose $str had the substring both prepended and - * appended - */ - public function surround($substring) - { - $str = implode('', array($substring, $this->str, $substring)); - - return static::create($str, $this->encoding); - } - - /** - * Inserts $substring into the string at the $index provided. - * - * @param string $substring String to be inserted - * @param int $index The index at which to insert the substring - * @return Stringy Object with the resulting $str after the insertion - */ - public function insert($substring, $index) - { - $stringy = static::create($this->str, $this->encoding); - if ($index > $stringy->length()) { - return $stringy; - } - - $start = mb_substr($stringy->str, 0, $index, $stringy->encoding); - $end = mb_substr($stringy->str, $index, $stringy->length(), - $stringy->encoding); - - $stringy->str = $start . $substring . $end; - - return $stringy; - } - - /** - * Truncates the string to a given length. If $substring is provided, and - * truncating occurs, the string is further truncated so that the substring - * may be appended without exceeding the desired length. - * - * @param int $length Desired length of the truncated string - * @param string $substring The substring to append if it can fit - * @return Stringy Object with the resulting $str after truncating - */ - public function truncate($length, $substring = '') - { - $stringy = static::create($this->str, $this->encoding); - if ($length >= $stringy->length()) { - return $stringy; - } - - // Need to further trim the string so we can append the substring - $substringLength = mb_strlen($substring, $stringy->encoding); - $length = $length - $substringLength; - - $truncated = mb_substr($stringy->str, 0, $length, $stringy->encoding); - $stringy->str = $truncated . $substring; - - return $stringy; - } - - /** - * Truncates the string to a given length, while ensuring that it does not - * split words. If $substring is provided, and truncating occurs, the - * string is further truncated so that the substring may be appended without - * exceeding the desired length. - * - * @param int $length Desired length of the truncated string - * @param string $substring The substring to append if it can fit - * @return Stringy Object with the resulting $str after truncating - */ - public function safeTruncate($length, $substring = '') - { - $stringy = static::create($this->str, $this->encoding); - if ($length >= $stringy->length()) { - return $stringy; - } - - // Need to further trim the string so we can append the substring - $encoding = $stringy->encoding; - $substringLength = mb_strlen($substring, $encoding); - $length = $length - $substringLength; - - $truncated = mb_substr($stringy->str, 0, $length, $encoding); - - // If the last word was truncated - if (mb_strpos($stringy->str, ' ', $length - 1, $encoding) != $length) { - // Find pos of the last occurrence of a space, get up to that - $lastPos = mb_strrpos($truncated, ' ', 0, $encoding); - $truncated = mb_substr($truncated, 0, $lastPos, $encoding); - } - - $stringy->str = $truncated . $substring; - - return $stringy; - } - - /** - * Returns a reversed string. A multibyte version of strrev(). - * - * @return Stringy Object with a reversed $str - */ - public function reverse() - { - $strLength = $this->length(); - $reversed = ''; - - // Loop from last index of string to first - for ($i = $strLength - 1; $i >= 0; $i--) { - $reversed .= mb_substr($this->str, $i, 1, $this->encoding); - } - - return static::create($reversed, $this->encoding); - } - - /** - * A multibyte str_shuffle() function. It returns a string with its - * characters in random order. - * - * @return Stringy Object with a shuffled $str - */ - public function shuffle() - { - $indexes = range(0, $this->length() - 1); - shuffle($indexes); - - $shuffledStr = ''; - foreach ($indexes as $i) { - $shuffledStr .= mb_substr($this->str, $i, 1, $this->encoding); - } - - return static::create($shuffledStr, $this->encoding); - } - - /** - * Returns a string with whitespace removed from the start and end of the - * string. Supports the removal of unicode whitespace. Accepts an optional - * string of characters to strip instead of the defaults. - * - * @param string $chars Optional string of characters to strip - * @return Stringy Object with a trimmed $str - */ - public function trim($chars = null) - { - $chars = ($chars) ? preg_quote($chars) : '[:space:]'; - - return $this->regexReplace("^[$chars]+|[$chars]+\$", ''); - } - - /** - * Returns a string with whitespace removed from the start of the string. - * Supports the removal of unicode whitespace. Accepts an optional - * string of characters to strip instead of the defaults. - * - * @param string $chars Optional string of characters to strip - * @return Stringy Object with a trimmed $str - */ - public function trimLeft($chars = null) - { - $chars = ($chars) ? preg_quote($chars) : '[:space:]'; - - return $this->regexReplace("^[$chars]+", ''); - } - - /** - * Returns a string with whitespace removed from the end of the string. - * Supports the removal of unicode whitespace. Accepts an optional - * string of characters to strip instead of the defaults. - * - * @param string $chars Optional string of characters to strip - * @return Stringy Object with a trimmed $str - */ - public function trimRight($chars = null) - { - $chars = ($chars) ? preg_quote($chars) : '[:space:]'; - - return $this->regexReplace("[$chars]+\$", ''); - } - - /** - * Returns the longest common prefix between the string and $otherStr. - * - * @param string $otherStr Second string for comparison - * @return Stringy Object with its $str being the longest common prefix - */ - public function longestCommonPrefix($otherStr) - { - $encoding = $this->encoding; - $maxLength = min($this->length(), mb_strlen($otherStr, $encoding)); - - $longestCommonPrefix = ''; - for ($i = 0; $i < $maxLength; $i++) { - $char = mb_substr($this->str, $i, 1, $encoding); - - if ($char == mb_substr($otherStr, $i, 1, $encoding)) { - $longestCommonPrefix .= $char; - } else { - break; - } - } - - return static::create($longestCommonPrefix, $encoding); - } - - /** - * Returns the longest common suffix between the string and $otherStr. - * - * @param string $otherStr Second string for comparison - * @return Stringy Object with its $str being the longest common suffix - */ - public function longestCommonSuffix($otherStr) - { - $encoding = $this->encoding; - $maxLength = min($this->length(), mb_strlen($otherStr, $encoding)); - - $longestCommonSuffix = ''; - for ($i = 1; $i <= $maxLength; $i++) { - $char = mb_substr($this->str, -$i, 1, $encoding); - - if ($char == mb_substr($otherStr, -$i, 1, $encoding)) { - $longestCommonSuffix = $char . $longestCommonSuffix; - } else { - break; - } - } - - return static::create($longestCommonSuffix, $encoding); - } - - /** - * Returns the longest common substring between the string and $otherStr. - * In the case of ties, it returns that which occurs first. - * - * @param string $otherStr Second string for comparison - * @return Stringy Object with its $str being the longest common substring - */ - public function longestCommonSubstring($otherStr) - { - // Uses dynamic programming to solve - // http://en.wikipedia.org/wiki/Longest_common_substring_problem - $encoding = $this->encoding; - $stringy = static::create($this->str, $encoding); - $strLength = $stringy->length(); - $otherLength = mb_strlen($otherStr, $encoding); - - // Return if either string is empty - if ($strLength == 0 || $otherLength == 0) { - $stringy->str = ''; - return $stringy; - } - - $len = 0; - $end = 0; - $table = array_fill(0, $strLength + 1, - array_fill(0, $otherLength + 1, 0)); - - for ($i = 1; $i <= $strLength; $i++) { - for ($j = 1; $j <= $otherLength; $j++) { - $strChar = mb_substr($stringy->str, $i - 1, 1, $encoding); - $otherChar = mb_substr($otherStr, $j - 1, 1, $encoding); - - if ($strChar == $otherChar) { - $table[$i][$j] = $table[$i - 1][$j - 1] + 1; - if ($table[$i][$j] > $len) { - $len = $table[$i][$j]; - $end = $i; - } - } else { - $table[$i][$j] = 0; - } - } - } - - $stringy->str = mb_substr($stringy->str, $end - $len, $len, $encoding); - - return $stringy; - } - - /** - * Returns the length of the string. An alias for PHP's mb_strlen() function. - * - * @return int The number of characters in $str given the encoding - */ - public function length() - { - return mb_strlen($this->str, $this->encoding); - } - - /** - * Returns the substring beginning at $start with the specified $length. - * It differs from the mb_substr() function in that providing a $length of - * null will return the rest of the string, rather than an empty string. - * - * @param int $start Position of the first character to use - * @param int $length Maximum number of characters used - * @return Stringy Object with its $str being the substring - */ - public function substr($start, $length = null) - { - $length = $length === null ? $this->length() : $length; - $str = mb_substr($this->str, $start, $length, $this->encoding); - - return static::create($str, $this->encoding); - } - - /** - * Returns the character at $index, with indexes starting at 0. - * - * @param int $index Position of the character - * @return Stringy The character at $index - */ - public function at($index) - { - return $this->substr($index, 1); - } - - /** - * Returns the first $n characters of the string. - * - * @param int $n Number of characters to retrieve from the start - * @return Stringy Object with its $str being the first $n chars - */ - public function first($n) - { - $stringy = static::create($this->str, $this->encoding); - - if ($n < 0) { - $stringy->str = ''; - } else { - return $stringy->substr(0, $n); - } - - return $stringy; - } - - /** - * Returns the last $n characters of the string. - * - * @param int $n Number of characters to retrieve from the end - * @return Stringy Object with its $str being the last $n chars - */ - public function last($n) - { - $stringy = static::create($this->str, $this->encoding); - - if ($n <= 0) { - $stringy->str = ''; - } else { - return $stringy->substr(-$n); - } - - return $stringy; - } - - /** - * Ensures that the string begins with $substring. If it doesn't, it's - * prepended. - * - * @param string $substring The substring to add if not present - * @return Stringy Object with its $str prefixed by the $substring - */ - public function ensureLeft($substring) - { - $stringy = static::create($this->str, $this->encoding); - - if (!$stringy->startsWith($substring)) { - $stringy->str = $substring . $stringy->str; - } - - return $stringy; - } - - /** - * Ensures that the string begins with $substring. If it doesn't, it's - * appended. - * - * @param string $substring The substring to add if not present - * @return Stringy Object with its $str suffixed by the $substring - */ - public function ensureRight($substring) - { - $stringy = static::create($this->str, $this->encoding); - - if (!$stringy->endsWith($substring)) { - $stringy->str .= $substring; - } - - return $stringy; - } - - /** - * Returns a new string with the prefix $substring removed, if present. - * - * @param string $substring The prefix to remove - * @return Stringy Object having a $str without the prefix $substring - */ - public function removeLeft($substring) - { - $stringy = static::create($this->str, $this->encoding); - - if ($stringy->startsWith($substring)) { - $substringLength = mb_strlen($substring, $stringy->encoding); - return $stringy->substr($substringLength); - } - - return $stringy; - } - - /** - * Returns a new string with the suffix $substring removed, if present. - * - * @param string $substring The suffix to remove - * @return Stringy Object having a $str without the suffix $substring - */ - public function removeRight($substring) - { - $stringy = static::create($this->str, $this->encoding); - - if ($stringy->endsWith($substring)) { - $substringLength = mb_strlen($substring, $stringy->encoding); - return $stringy->substr(0, $stringy->length() - $substringLength); - } - - return $stringy; - } - - /** - * Returns true if $str matches the supplied pattern, false otherwise. - * - * @param string $pattern Regex pattern to match against - * @return bool Whether or not $str matches the pattern - */ - private function matchesPattern($pattern) - { - $regexEncoding = mb_regex_encoding(); - mb_regex_encoding($this->encoding); - - $match = mb_ereg_match($pattern, $this->str); - mb_regex_encoding($regexEncoding); - - return $match; - } - - /** - * Returns true if the string contains a lower case char, false - * otherwise. - * - * @return bool Whether or not the string contains a lower case character. - */ - public function hasLowerCase() - { - return $this->matchesPattern('.*[[:lower:]]'); - } - - /** - * Returns true if the string contains an upper case char, false - * otherwise. - * - * @return bool Whether or not the string contains an upper case character. - */ - public function hasUpperCase() - { - return $this->matchesPattern('.*[[:upper:]]'); - } - - /** - * Returns true if the string contains only alphabetic chars, false - * otherwise. - * - * @return bool Whether or not $str contains only alphabetic chars - */ - public function isAlpha() - { - return $this->matchesPattern('^[[:alpha:]]*$'); - } - - /** - * Returns true if the string contains only alphabetic and numeric chars, - * false otherwise. - * - * @return bool Whether or not $str contains only alphanumeric chars - */ - public function isAlphanumeric() - { - return $this->matchesPattern('^[[:alnum:]]*$'); - } - - /** - * Returns true if the string contains only hexadecimal chars, false - * otherwise. - * - * @return bool Whether or not $str contains only hexadecimal chars - */ - public function isHexadecimal() - { - return $this->matchesPattern('^[[:xdigit:]]*$'); - } - - /** - * Returns true if the string contains only whitespace chars, false - * otherwise. - * - * @return bool Whether or not $str contains only whitespace characters - */ - public function isBlank() - { - return $this->matchesPattern('^[[:space:]]*$'); - } - - /** - * Returns true if the string is JSON, false otherwise. - * - * @return bool Whether or not $str is JSON - */ - public function isJson() - { - json_decode($this->str); - - return (json_last_error() === JSON_ERROR_NONE); - } - - /** - * Returns true if the string contains only lower case chars, false - * otherwise. - * - * @return bool Whether or not $str contains only lower case characters - */ - public function isLowerCase() - { - return $this->matchesPattern('^[[:lower:]]*$'); - } - - /** - * Returns true if the string contains only lower case chars, false - * otherwise. - * - * @return bool Whether or not $str contains only lower case characters - */ - public function isUpperCase() - { - return $this->matchesPattern('^[[:upper:]]*$'); - } - - /** - * Returns true if the string is serialized, false otherwise. - * - * @return bool Whether or not $str is serialized - */ - public function isSerialized() - { - return $this->str === 'b:0;' || @unserialize($this->str) !== false; - } - - /** - * Returns the number of occurrences of $substring in the given string. - * By default, the comparison is case-sensitive, but can be made insensitive - * by setting $caseSensitive to false. - * - * @param string $substring The substring to search for - * @param bool $caseSensitive Whether or not to enforce case-sensitivity - * @return int The number of $substring occurrences - */ - public function countSubstr($substring, $caseSensitive = true) - { - if ($caseSensitive) { - return mb_substr_count($this->str, $substring, $this->encoding); - } - - $str = mb_strtoupper($this->str, $this->encoding); - $substring = mb_strtoupper($substring, $this->encoding); - - return mb_substr_count($str, $substring, $this->encoding); - } - - /** - * Replaces all occurrences of $search in $str by $replacement. - * - * @param string $search The needle to search for - * @param string $replacement The string to replace with - * @return Stringy Object with the resulting $str after the replacements - */ - public function replace($search, $replacement) - { - return $this->regexReplace(preg_quote($search), $replacement); - } - - /** - * Replaces all occurrences of $pattern in $str by $replacement. An alias - * for mb_ereg_replace(). Note that the 'i' option with multibyte patterns - * in mb_ereg_replace() requires PHP 5.4+. This is due to a lack of support - * in the bundled version of Oniguruma in PHP 5.3. - * - * @param string $pattern The regular expression pattern - * @param string $replacement The string to replace with - * @param string $options Matching conditions to be used - * @return Stringy Object with the resulting $str after the replacements - */ - public function regexReplace($pattern, $replacement, $options = 'msr') - { - $regexEncoding = mb_regex_encoding(); - mb_regex_encoding($this->encoding); - - $str = mb_ereg_replace($pattern, $replacement, $this->str, $options); - mb_regex_encoding($regexEncoding); - - return static::create($str, $this->encoding); - } - - /** - * Convert all applicable characters to HTML entities. - * - * @param int|null $flags See http://php.net/manual/en/function.htmlentities.php - * @return Stringy Object with the resulting $str after being html encoded. - */ - public function htmlEncode($flags = ENT_COMPAT) - { - $str = htmlentities($this->str, $flags, $this->encoding); - - return static::create($str, $this->encoding); - } - - /** - * Convert all HTML entities to their applicable characters. - * - * @param int|null $flags See http://php.net/manual/en/function.html-entity-decode.php - * @return Stringy Object with the resulting $str after being html decoded. - */ - public function htmlDecode($flags = ENT_COMPAT) - { - $str = html_entity_decode($this->str, $flags, $this->encoding); - - return static::create($str, $this->encoding); - } -} diff --git a/application/vendor/danielstjules/stringy/tests/CommonTest.php b/application/vendor/danielstjules/stringy/tests/CommonTest.php deleted file mode 100644 index 285deb5..0000000 --- a/application/vendor/danielstjules/stringy/tests/CommonTest.php +++ /dev/null @@ -1,1130 +0,0 @@ -assertInstanceOf('Stringy\Stringy', $actual); - } - - public function indexOfProvider() - { - return array( - array(2, 'This is the string', 'is'), - array(2, 'This is the string', 'is', 0, 'UTF-8'), - array(false, 'This is the string', 'not-found', 0, 'UTF-8'), - array(32, 'This is the string... and there is another thing', 'is', 10, 'UTF-8'), - ); - } - - public function indexOfLastProvider() - { - return array( - array(5, 'This is the string', 'is'), - array(5, 'This is the string', 'is', 0, 'UTF-8'), - array(false, 'This is the string', 'not-found', 0, 'UTF-8'), - array(32, 'This is the string... and there is another thing', 'is', 0, 'UTF-8'), - ); - } - - public function charsProvider() - { - return array( - array(array(), ''), - array(array('T', 'e', 's', 't'), 'Test'), - array(array('F', 'ò', 'ô', ' ', 'B', 'à', 'ř'), 'Fòô Bàř', 'UTF-8') - ); - } - - public function upperCaseFirstProvider() - { - return array( - array('Test', 'Test'), - array('Test', 'test'), - array('1a', '1a'), - array('Σ test', 'σ test', 'UTF-8'), - array(' σ test', ' σ test', 'UTF-8') - ); - } - - public function lowerCaseFirstProvider() - { - return array( - array('test', 'Test'), - array('test', 'test'), - array('1a', '1a'), - array('σ test', 'Σ test', 'UTF-8'), - array(' Σ test', ' Σ test', 'UTF-8') - ); - } - - public function camelizeProvider() - { - return array( - array('camelCase', 'CamelCase'), - array('camelCase', 'Camel-Case'), - array('camelCase', 'camel case'), - array('camelCase', 'camel -case'), - array('camelCase', 'camel - case'), - array('camelCase', 'camel_case'), - array('camelCTest', 'camel c test'), - array('stringWith1Number', 'string_with1number'), - array('stringWith22Numbers', 'string-with-2-2 numbers'), - array('1Camel2Case', '1camel2case'), - array('camelΣase', 'camel σase', 'UTF-8'), - array('στανιλCase', 'Στανιλ case', 'UTF-8'), - array('σamelCase', 'σamel Case', 'UTF-8') - ); - } - - public function upperCamelizeProvider() - { - return array( - array('CamelCase', 'camelCase'), - array('CamelCase', 'Camel-Case'), - array('CamelCase', 'camel case'), - array('CamelCase', 'camel -case'), - array('CamelCase', 'camel - case'), - array('CamelCase', 'camel_case'), - array('CamelCTest', 'camel c test'), - array('StringWith1Number', 'string_with1number'), - array('StringWith22Numbers', 'string-with-2-2 numbers'), - array('1Camel2Case', '1camel2case'), - array('CamelΣase', 'camel σase', 'UTF-8'), - array('ΣτανιλCase', 'στανιλ case', 'UTF-8'), - array('ΣamelCase', 'Σamel Case', 'UTF-8') - ); - } - - public function dasherizeProvider() - { - return array( - array('test-case', 'testCase'), - array('test-case', 'Test-Case'), - array('test-case', 'test case'), - array('-test-case', '-test -case'), - array('test-case', 'test - case'), - array('test-case', 'test_case'), - array('test-c-test', 'test c test'), - array('test-d-case', 'TestDCase'), - array('test-c-c-test', 'TestCCTest'), - array('string-with1number', 'string_with1number'), - array('string-with-2-2-numbers', 'String-with_2_2 numbers'), - array('1test2case', '1test2case'), - array('dash-σase', 'dash Σase', 'UTF-8'), - array('στανιλ-case', 'Στανιλ case', 'UTF-8'), - array('σash-case', 'Σash Case', 'UTF-8') - ); - } - - public function underscoredProvider() - { - return array( - array('test_case', 'testCase'), - array('test_case', 'Test-Case'), - array('test_case', 'test case'), - array('test_case', 'test -case'), - array('_test_case', '-test - case'), - array('test_case', 'test_case'), - array('test_c_test', ' test c test'), - array('test_u_case', 'TestUCase'), - array('test_c_c_test', 'TestCCTest'), - array('string_with1number', 'string_with1number'), - array('string_with_2_2_numbers', 'String-with_2_2 numbers'), - array('1test2case', '1test2case'), - array('test_σase', 'test Σase', 'UTF-8'), - array('στανιλ_case', 'Στανιλ case', 'UTF-8'), - array('σash_case', 'Σash Case', 'UTF-8') - ); - } - - public function delimitProvider() - { - return array( - array('test*case', 'testCase', '*'), - array('test&case', 'Test-Case', '&'), - array('test#case', 'test case', '#'), - array('test**case', 'test -case', '**'), - array('~!~test~!~case', '-test - case', '~!~'), - array('test*case', 'test_case', '*'), - array('test%c%test', ' test c test', '%'), - array('test+u+case', 'TestUCase', '+'), - array('test=c=c=test', 'TestCCTest', '='), - array('string#>with1number', 'string_with1number', '#>'), - array('1test2case', '1test2case', '*'), - array('test ύα σase', 'test Σase', ' ύα ', 'UTF-8',), - array('στανιλαcase', 'Στανιλ case', 'α', 'UTF-8',), - array('σashΘcase', 'Σash Case', 'Θ', 'UTF-8') - ); - } - - public function swapCaseProvider() - { - return array( - array('TESTcASE', 'testCase'), - array('tEST-cASE', 'Test-Case'), - array(' - σASH cASE', ' - Σash Case', 'UTF-8'), - array('νΤΑΝΙΛ', 'Ντανιλ', 'UTF-8') - ); - } - - public function titleizeProvider() - { - $ignore = array('at', 'by', 'for', 'in', 'of', 'on', 'out', 'to', 'the'); - - return array( - array('Testing The Method', 'testing the method'), - array('Testing the Method', 'testing the method', $ignore, 'UTF-8'), - array('I Like to Watch DVDs at Home', 'i like to watch DVDs at home', - $ignore, 'UTF-8'), - array('Θα Ήθελα Να Φύγει', ' Θα ήθελα να φύγει ', null, 'UTF-8') - ); - } - - public function humanizeProvider() - { - return array( - array('Author', 'author_id'), - array('Test user', ' _test_user_'), - array('Συγγραφέας', ' συγγραφέας_id ', 'UTF-8') - ); - } - - public function tidyProvider() - { - return array( - array('"I see..."', '“I see…”'), - array("'This too'", "‘This too’"), - array('test-dash', 'test—dash'), - array('Ο συγγραφέας είπε...', 'Ο συγγραφέας είπε…') - ); - } - - public function collapseWhitespaceProvider() - { - return array( - array('foo bar', ' foo bar '), - array('test string', 'test string'), - array('Ο συγγραφέας', ' Ο συγγραφέας '), - array('123', ' 123 '), - array('', ' ', 'UTF-8'), // no-break space (U+00A0) - array('', '           ', 'UTF-8'), // spaces U+2000 to U+200A - array('', ' ', 'UTF-8'), // narrow no-break space (U+202F) - array('', ' ', 'UTF-8'), // medium mathematical space (U+205F) - array('', ' ', 'UTF-8'), // ideographic space (U+3000) - array('1 2 3', '  1  2  3  ', 'UTF-8'), - array('', ' '), - array('', ''), - ); - } - - public function toAsciiProvider() - { - return array( - array('foo bar', 'fòô bàř'), - array(' TEST ', ' ŤÉŚŢ '), - array('f = z = 3', 'φ = ź = 3'), - array('perevirka', 'перевірка'), - array('lysaya gora', 'лысая гора'), - array('shchuka', 'щука'), - array('', '漢字'), - array('xin chao the gioi', 'xin chào thế giới'), - array('XIN CHAO THE GIOI', 'XIN CHÀO THẾ GIỚI'), - array('dam phat chet luon', 'đấm phát chết luôn'), - array(' ', ' '), // no-break space (U+00A0) - array(' ', '           '), // spaces U+2000 to U+200A - array(' ', ' '), // narrow no-break space (U+202F) - array(' ', ' '), // medium mathematical space (U+205F) - array(' ', ' '), // ideographic space (U+3000) - array('', '𐍉'), // some uncommon, unsupported character (U+10349) - array('𐍉', '𐍉', false), - ); - } - - public function padProvider() - { - return array( - // length <= str - array('foo bar', 'foo bar', -1), - array('foo bar', 'foo bar', 7), - array('fòô bàř', 'fòô bàř', 7, ' ', 'right', 'UTF-8'), - - // right - array('foo bar ', 'foo bar', 9), - array('foo bar_*', 'foo bar', 9, '_*', 'right'), - array('fòô bàř¬ø¬', 'fòô bàř', 10, '¬ø', 'right', 'UTF-8'), - - // left - array(' foo bar', 'foo bar', 9, ' ', 'left'), - array('_*foo bar', 'foo bar', 9, '_*', 'left'), - array('¬ø¬fòô bàř', 'fòô bàř', 10, '¬ø', 'left', 'UTF-8'), - - // both - array('foo bar ', 'foo bar', 8, ' ', 'both'), - array('¬fòô bàř¬ø', 'fòô bàř', 10, '¬ø', 'both', 'UTF-8'), - array('¬øfòô bàř¬øÿ', 'fòô bàř', 12, '¬øÿ', 'both', 'UTF-8') - ); - } - - public function padLeftProvider() - { - return array( - array(' foo bar', 'foo bar', 9), - array('_*foo bar', 'foo bar', 9, '_*'), - array('_*_foo bar', 'foo bar', 10, '_*'), - array(' fòô bàř', 'fòô bàř', 9, ' ', 'UTF-8'), - array('¬øfòô bàř', 'fòô bàř', 9, '¬ø', 'UTF-8'), - array('¬ø¬fòô bàř', 'fòô bàř', 10, '¬ø', 'UTF-8'), - array('¬ø¬øfòô bàř', 'fòô bàř', 11, '¬ø', 'UTF-8'), - ); - } - - public function padRightProvider() - { - return array( - array('foo bar ', 'foo bar', 9), - array('foo bar_*', 'foo bar', 9, '_*'), - array('foo bar_*_', 'foo bar', 10, '_*'), - array('fòô bàř ', 'fòô bàř', 9, ' ', 'UTF-8'), - array('fòô bàř¬ø', 'fòô bàř', 9, '¬ø', 'UTF-8'), - array('fòô bàř¬ø¬', 'fòô bàř', 10, '¬ø', 'UTF-8'), - array('fòô bàř¬ø¬ø', 'fòô bàř', 11, '¬ø', 'UTF-8'), - ); - } - - public function padBothProvider() - { - return array( - array('foo bar ', 'foo bar', 8), - array(' foo bar ', 'foo bar', 9, ' '), - array('fòô bàř ', 'fòô bàř', 8, ' ', 'UTF-8'), - array(' fòô bàř ', 'fòô bàř', 9, ' ', 'UTF-8'), - array('fòô bàř¬', 'fòô bàř', 8, '¬ø', 'UTF-8'), - array('¬fòô bàř¬', 'fòô bàř', 9, '¬ø', 'UTF-8'), - array('¬fòô bàř¬ø', 'fòô bàř', 10, '¬ø', 'UTF-8'), - array('¬øfòô bàř¬ø', 'fòô bàř', 11, '¬ø', 'UTF-8'), - array('¬fòô bàř¬ø', 'fòô bàř', 10, '¬øÿ', 'UTF-8'), - array('¬øfòô bàř¬ø', 'fòô bàř', 11, '¬øÿ', 'UTF-8'), - array('¬øfòô bàř¬øÿ', 'fòô bàř', 12, '¬øÿ', 'UTF-8') - ); - } - - public function startsWithProvider() - { - return array( - array(true, 'foo bars', 'foo bar'), - array(true, 'FOO bars', 'foo bar', false), - array(true, 'FOO bars', 'foo BAR', false), - array(true, 'FÒÔ bàřs', 'fòô bàř', false, 'UTF-8'), - array(true, 'fòô bàřs', 'fòô BÀŘ', false, 'UTF-8'), - array(false, 'foo bar', 'bar'), - array(false, 'foo bar', 'foo bars'), - array(false, 'FOO bar', 'foo bars'), - array(false, 'FOO bars', 'foo BAR'), - array(false, 'FÒÔ bàřs', 'fòô bàř', true, 'UTF-8'), - array(false, 'fòô bàřs', 'fòô BÀŘ', true, 'UTF-8'), - ); - } - - public function endsWithProvider() - { - return array( - array(true, 'foo bars', 'o bars'), - array(true, 'FOO bars', 'o bars', false), - array(true, 'FOO bars', 'o BARs', false), - array(true, 'FÒÔ bàřs', 'ô bàřs', false, 'UTF-8'), - array(true, 'fòô bàřs', 'ô BÀŘs', false, 'UTF-8'), - array(false, 'foo bar', 'foo'), - array(false, 'foo bar', 'foo bars'), - array(false, 'FOO bar', 'foo bars'), - array(false, 'FOO bars', 'foo BARS'), - array(false, 'FÒÔ bàřs', 'fòô bàřs', true, 'UTF-8'), - array(false, 'fòô bàřs', 'fòô BÀŘS', true, 'UTF-8'), - ); - } - - public function toSpacesProvider() - { - return array( - array(' foo bar ', ' foo bar '), - array(' foo bar ', ' foo bar ', 5), - array(' foo bar ', ' foo bar ', 2), - array('foobar', ' foo bar ', 0), - array(" foo\n bar", " foo\n bar"), - array(" fòô\n bàř", " fòô\n bàř") - ); - } - - public function toTabsProvider() - { - return array( - array(' foo bar ', ' foo bar '), - array(' foo bar ', ' foo bar ', 5), - array(' foo bar ', ' foo bar ', 2), - array(" foo\n bar", " foo\n bar"), - array(" fòô\n bàř", " fòô\n bàř") - ); - } - - public function toLowerCaseProvider() - { - return array( - array('foo bar', 'FOO BAR'), - array(' foo_bar ', ' FOO_bar '), - array('fòô bàř', 'FÒÔ BÀŘ', 'UTF-8'), - array(' fòô_bàř ', ' FÒÔ_bàř ', 'UTF-8'), - array('αυτοκίνητο', 'ΑΥΤΟΚΊΝΗΤΟ', 'UTF-8'), - ); - } - - public function toTitleCaseProvider() - { - return array( - array('Foo Bar', 'foo bar'), - array(' Foo_Bar ', ' foo_bar '), - array('Fòô Bàř', 'fòô bàř', 'UTF-8'), - array(' Fòô_Bàř ', ' fòô_bàř ', 'UTF-8'), - array('Αυτοκίνητο Αυτοκίνητο', 'αυτοκίνητο αυτοκίνητο', 'UTF-8'), - ); - } - - public function toUpperCaseProvider() - { - return array( - array('FOO BAR', 'foo bar'), - array(' FOO_BAR ', ' FOO_bar '), - array('FÒÔ BÀŘ', 'fòô bàř', 'UTF-8'), - array(' FÒÔ_BÀŘ ', ' FÒÔ_bàř ', 'UTF-8'), - array('ΑΥΤΟΚΊΝΗΤΟ', 'αυτοκίνητο', 'UTF-8'), - ); - } - - public function slugifyProvider() - { - return array( - array('foo-bar', ' foo bar '), - array('foo-bar', 'foo -.-"-...bar'), - array('another-foo-bar', 'another..& foo -.-"-...bar'), - array('foo-dbar', " Foo d'Bar "), - array('a-string-with-dashes', 'A string-with-dashes'), - array('using-strings-like-foo-bar', 'Using strings like fòô bàř'), - array('numbers-1234', 'numbers 1234'), - array('perevirka-ryadka', 'перевірка рядка'), - array('bukvar-s-bukvoy-y', 'букварь с буквой ы'), - array('podekhal-k-podezdu-moego-doma', 'подъехал к подъезду моего дома'), - array('foo:bar:baz', 'Foo bar baz', ':'), - array('a_string_with_underscores', 'A_string with_underscores', '_'), - array('a_string_with_dashes', 'A string-with-dashes', '_'), - array('a\string\with\dashes', 'A string-with-dashes', '\\'), - array('an_odd_string', '-- An odd__ string-_', '_') - ); - } - - public function containsProvider() - { - return array( - array(true, 'Str contains foo bar', 'foo bar'), - array(true, '12398!@(*%!@# @!%#*&^%', ' @!%#*&^%'), - array(true, 'Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'å´¥©', true, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'å˚ ∆', true, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'øœ¬', true, 'UTF-8'), - array(false, 'Str contains foo bar', 'Foo bar'), - array(false, 'Str contains foo bar', 'foobar'), - array(false, 'Str contains foo bar', 'foo bar '), - array(false, 'Ο συγγραφέας είπε', ' συγγραφέας ', true, 'UTF-8'), - array(false, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', ' ßå˚', true, 'UTF-8'), - array(true, 'Str contains foo bar', 'Foo bar', false), - array(true, '12398!@(*%!@# @!%#*&^%', ' @!%#*&^%', false), - array(true, 'Ο συγγραφέας είπε', 'ΣΥΓΓΡΑΦΈΑΣ', false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'Å´¥©', false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'Å˚ ∆', false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'ØŒ¬', false, 'UTF-8'), - array(false, 'Str contains foo bar', 'foobar', false), - array(false, 'Str contains foo bar', 'foo bar ', false), - array(false, 'Ο συγγραφέας είπε', ' συγγραφέας ', false, 'UTF-8'), - array(false, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', ' ßÅ˚', false, 'UTF-8') - ); - } - - public function containsAnyProvider() - { - // One needle - $singleNeedle = array_map(function ($array) { - $array[2] = array($array[2]); - return $array; - }, $this->containsProvider()); - - $provider = array( - // No needles - array(false, 'Str contains foo bar', array()), - // Multiple needles - array(true, 'Str contains foo bar', array('foo', 'bar')), - array(true, '12398!@(*%!@# @!%#*&^%', array(' @!%#*', '&^%')), - array(true, 'Ο συγγραφέας είπε', array('συγγρ', 'αφέας'), 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('å´¥', '©'), true, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('å˚ ', '∆'), true, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('øœ', '¬'), true, 'UTF-8'), - array(false, 'Str contains foo bar', array('Foo', 'Bar')), - array(false, 'Str contains foo bar', array('foobar', 'bar ')), - array(false, 'Str contains foo bar', array('foo bar ', ' foo')), - array(false, 'Ο συγγραφέας είπε', array(' συγγραφέας ', ' συγγραφ '), true, 'UTF-8'), - array(false, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array(' ßå˚', ' ß '), true, 'UTF-8'), - array(true, 'Str contains foo bar', array('Foo bar', 'bar'), false), - array(true, '12398!@(*%!@# @!%#*&^%', array(' @!%#*&^%', '*&^%'), false), - array(true, 'Ο συγγραφέας είπε', array('ΣΥΓΓΡΑΦΈΑΣ', 'ΑΦΈΑ'), false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('Å´¥©', '¥©'), false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('Å˚ ∆', ' ∆'), false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('ØŒ¬', 'Œ'), false, 'UTF-8'), - array(false, 'Str contains foo bar', array('foobar', 'none'), false), - array(false, 'Str contains foo bar', array('foo bar ', ' ba '), false), - array(false, 'Ο συγγραφέας είπε', array(' συγγραφέας ', ' ραφέ '), false, 'UTF-8'), - array(false, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array(' ßÅ˚', ' Å˚ '), false, 'UTF-8'), - ); - - return array_merge($singleNeedle, $provider); - } - - public function containsAllProvider() - { - // One needle - $singleNeedle = array_map(function ($array) { - $array[2] = array($array[2]); - return $array; - }, $this->containsProvider()); - - $provider = array( - // One needle - array(false, 'Str contains foo bar', array()), - // Multiple needles - array(true, 'Str contains foo bar', array('foo', 'bar')), - array(true, '12398!@(*%!@# @!%#*&^%', array(' @!%#*', '&^%')), - array(true, 'Ο συγγραφέας είπε', array('συγγρ', 'αφέας'), 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('å´¥', '©'), true, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('å˚ ', '∆'), true, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('øœ', '¬'), true, 'UTF-8'), - array(false, 'Str contains foo bar', array('Foo', 'bar')), - array(false, 'Str contains foo bar', array('foobar', 'bar')), - array(false, 'Str contains foo bar', array('foo bar ', 'bar')), - array(false, 'Ο συγγραφέας είπε', array(' συγγραφέας ', ' συγγραφ '), true, 'UTF-8'), - array(false, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array(' ßå˚', ' ß '), true, 'UTF-8'), - array(true, 'Str contains foo bar', array('Foo bar', 'bar'), false), - array(true, '12398!@(*%!@# @!%#*&^%', array(' @!%#*&^%', '*&^%'), false), - array(true, 'Ο συγγραφέας είπε', array('ΣΥΓΓΡΑΦΈΑΣ', 'ΑΦΈΑ'), false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('Å´¥©', '¥©'), false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('Å˚ ∆', ' ∆'), false, 'UTF-8'), - array(true, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array('ØŒ¬', 'Œ'), false, 'UTF-8'), - array(false, 'Str contains foo bar', array('foobar', 'none'), false), - array(false, 'Str contains foo bar', array('foo bar ', ' ba'), false), - array(false, 'Ο συγγραφέας είπε', array(' συγγραφέας ', ' ραφέ '), false, 'UTF-8'), - array(false, 'å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', array(' ßÅ˚', ' Å˚ '), false, 'UTF-8'), - ); - - return array_merge($singleNeedle, $provider); - } - - public function surroundProvider() - { - return array( - array('__foobar__', 'foobar', '__'), - array('test', 'test', ''), - array('**', '', '*'), - array('¬fòô bàř¬', 'fòô bàř', '¬'), - array('ßå∆˚ test ßå∆˚', ' test ', 'ßå∆˚') - ); - } - - public function insertProvider() - { - return array( - array('foo bar', 'oo bar', 'f', 0), - array('foo bar', 'f bar', 'oo', 1), - array('f bar', 'f bar', 'oo', 20), - array('foo bar', 'foo ba', 'r', 6), - array('fòô bàř', 'òô bàř', 'f', 0, 'UTF-8'), - array('fòô bàř', 'f bàř', 'òô', 1, 'UTF-8'), - array('fòô bàř', 'fòô bà', 'ř', 6, 'UTF-8') - ); - } - - public function truncateProvider() - { - return array( - array('Test foo bar', 'Test foo bar', 12), - array('Test foo ba', 'Test foo bar', 11), - array('Test foo', 'Test foo bar', 8), - array('Test fo', 'Test foo bar', 7), - array('Test', 'Test foo bar', 4), - array('Test foo bar', 'Test foo bar', 12, '...'), - array('Test foo...', 'Test foo bar', 11, '...'), - array('Test ...', 'Test foo bar', 8, '...'), - array('Test...', 'Test foo bar', 7, '...'), - array('T...', 'Test foo bar', 4, '...'), - array('Test fo....', 'Test foo bar', 11, '....'), - array('Test fòô bàř', 'Test fòô bàř', 12, '', 'UTF-8'), - array('Test fòô bà', 'Test fòô bàř', 11, '', 'UTF-8'), - array('Test fòô', 'Test fòô bàř', 8, '', 'UTF-8'), - array('Test fò', 'Test fòô bàř', 7, '', 'UTF-8'), - array('Test', 'Test fòô bàř', 4, '', 'UTF-8'), - array('Test fòô bàř', 'Test fòô bàř', 12, 'ϰϰ', 'UTF-8'), - array('Test fòô ϰϰ', 'Test fòô bàř', 11, 'ϰϰ', 'UTF-8'), - array('Test fϰϰ', 'Test fòô bàř', 8, 'ϰϰ', 'UTF-8'), - array('Test ϰϰ', 'Test fòô bàř', 7, 'ϰϰ', 'UTF-8'), - array('Teϰϰ', 'Test fòô bàř', 4, 'ϰϰ', 'UTF-8'), - array('What are your pl...', 'What are your plans today?', 19, '...') - ); - } - - public function safeTruncateProvider() - { - return array( - array('Test foo bar', 'Test foo bar', 12), - array('Test foo', 'Test foo bar', 11), - array('Test foo', 'Test foo bar', 8), - array('Test', 'Test foo bar', 7), - array('Test', 'Test foo bar', 4), - array('Test foo bar', 'Test foo bar', 12, '...'), - array('Test foo...', 'Test foo bar', 11, '...'), - array('Test...', 'Test foo bar', 8, '...'), - array('Test...', 'Test foo bar', 7, '...'), - array('...', 'Test foo bar', 4, '...'), - array('Test....', 'Test foo bar', 11, '....'), - array('Test fòô bàř', 'Test fòô bàř', 12, '', 'UTF-8'), - array('Test fòô', 'Test fòô bàř', 11, '', 'UTF-8'), - array('Test fòô', 'Test fòô bàř', 8, '', 'UTF-8'), - array('Test', 'Test fòô bàř', 7, '', 'UTF-8'), - array('Test', 'Test fòô bàř', 4, '', 'UTF-8'), - array('Test fòô bàř', 'Test fòô bàř', 12, 'ϰϰ', 'UTF-8'), - array('Test fòôϰϰ', 'Test fòô bàř', 11, 'ϰϰ', 'UTF-8'), - array('Testϰϰ', 'Test fòô bàř', 8, 'ϰϰ', 'UTF-8'), - array('Testϰϰ', 'Test fòô bàř', 7, 'ϰϰ', 'UTF-8'), - array('ϰϰ', 'Test fòô bàř', 4, 'ϰϰ', 'UTF-8'), - array('What are your plans...', 'What are your plans today?', 22, '...') - ); - } - - public function reverseProvider() - { - return array( - array('', ''), - array('raboof', 'foobar'), - array('řàbôòf', 'fòôbàř', 'UTF-8'), - array('řàb ôòf', 'fòô bàř', 'UTF-8'), - array('∂∆ ˚åß', 'ßå˚ ∆∂', 'UTF-8') - ); - } - - public function shuffleProvider() - { - return array( - array('foo bar'), - array('∂∆ ˚åß', 'UTF-8'), - array('å´¥©¨ˆßå˚ ∆∂˙©å∑¥øœ¬', 'UTF-8') - ); - } - - public function trimProvider() - { - return array( - array('foo bar', ' foo bar '), - array('foo bar', ' foo bar'), - array('foo bar', 'foo bar '), - array('foo bar', "\n\t foo bar \n\t"), - array('fòô bàř', ' fòô bàř '), - array('fòô bàř', ' fòô bàř'), - array('fòô bàř', 'fòô bàř '), - array(' foo bar ', "\n\t foo bar \n\t", "\n\t"), - array('fòô bàř', "\n\t fòô bàř \n\t", null, 'UTF-8'), - array('fòô', ' fòô ', null, 'UTF-8'), // narrow no-break space (U+202F) - array('fòô', '  fòô  ', null, 'UTF-8'), // medium mathematical space (U+205F) - array('fòô', '           fòô', null, 'UTF-8') // spaces U+2000 to U+200A - ); - } - - public function trimLeftProvider() - { - return array( - array('foo bar ', ' foo bar '), - array('foo bar', ' foo bar'), - array('foo bar ', 'foo bar '), - array("foo bar \n\t", "\n\t foo bar \n\t"), - array('fòô bàř ', ' fòô bàř '), - array('fòô bàř', ' fòô bàř'), - array('fòô bàř ', 'fòô bàř '), - array('foo bar', '--foo bar', '-'), - array('fòô bàř', 'òòfòô bàř', 'ò', 'UTF-8'), - array("fòô bàř \n\t", "\n\t fòô bàř \n\t", null, 'UTF-8'), - array('fòô ', ' fòô ', null, 'UTF-8'), // narrow no-break space (U+202F) - array('fòô  ', '  fòô  ', null, 'UTF-8'), // medium mathematical space (U+205F) - array('fòô', '           fòô', null, 'UTF-8') // spaces U+2000 to U+200A - ); - } - - public function trimRightProvider() - { - return array( - array(' foo bar', ' foo bar '), - array('foo bar', 'foo bar '), - array(' foo bar', ' foo bar'), - array("\n\t foo bar", "\n\t foo bar \n\t"), - array(' fòô bàř', ' fòô bàř '), - array('fòô bàř', 'fòô bàř '), - array(' fòô bàř', ' fòô bàř'), - array('foo bar', 'foo bar--', '-'), - array('fòô bàř', 'fòô bàřòò', 'ò', 'UTF-8'), - array("\n\t fòô bàř", "\n\t fòô bàř \n\t", null, 'UTF-8'), - array(' fòô', ' fòô ', null, 'UTF-8'), // narrow no-break space (U+202F) - array('  fòô', '  fòô  ', null, 'UTF-8'), // medium mathematical space (U+205F) - array('fòô', 'fòô           ', null, 'UTF-8') // spaces U+2000 to U+200A - ); - } - - public function longestCommonPrefixProvider() - { - return array( - array('foo', 'foobar', 'foo bar'), - array('foo bar', 'foo bar', 'foo bar'), - array('f', 'foo bar', 'far boo'), - array('', 'toy car', 'foo bar'), - array('', 'foo bar', ''), - array('fòô', 'fòôbar', 'fòô bar', 'UTF-8'), - array('fòô bar', 'fòô bar', 'fòô bar', 'UTF-8'), - array('fò', 'fòô bar', 'fòr bar', 'UTF-8'), - array('', 'toy car', 'fòô bar', 'UTF-8'), - array('', 'fòô bar', '', 'UTF-8'), - ); - } - - public function longestCommonSuffixProvider() - { - return array( - array('bar', 'foobar', 'foo bar'), - array('foo bar', 'foo bar', 'foo bar'), - array('ar', 'foo bar', 'boo far'), - array('', 'foo bad', 'foo bar'), - array('', 'foo bar', ''), - array('bàř', 'fòôbàř', 'fòô bàř', 'UTF-8'), - array('fòô bàř', 'fòô bàř', 'fòô bàř', 'UTF-8'), - array(' bàř', 'fòô bàř', 'fòr bàř', 'UTF-8'), - array('', 'toy car', 'fòô bàř', 'UTF-8'), - array('', 'fòô bàř', '', 'UTF-8'), - ); - } - - public function longestCommonSubstringProvider() - { - return array( - array('foo', 'foobar', 'foo bar'), - array('foo bar', 'foo bar', 'foo bar'), - array('oo ', 'foo bar', 'boo far'), - array('foo ba', 'foo bad', 'foo bar'), - array('', 'foo bar', ''), - array('fòô', 'fòôbàř', 'fòô bàř', 'UTF-8'), - array('fòô bàř', 'fòô bàř', 'fòô bàř', 'UTF-8'), - array(' bàř', 'fòô bàř', 'fòr bàř', 'UTF-8'), - array(' ', 'toy car', 'fòô bàř', 'UTF-8'), - array('', 'fòô bàř', '', 'UTF-8'), - ); - } - - public function lengthProvider() - { - return array( - array(11, ' foo bar '), - array(1, 'f'), - array(0, ''), - array(7, 'fòô bàř', 'UTF-8') - ); - } - - public function substrProvider() - { - return array( - array('foo bar', 'foo bar', 0), - array('bar', 'foo bar', 4), - array('bar', 'foo bar', 4, null), - array('o b', 'foo bar', 2, 3), - array('', 'foo bar', 4, 0), - array('fòô bàř', 'fòô bàř', 0, null, 'UTF-8'), - array('bàř', 'fòô bàř', 4, null, 'UTF-8'), - array('ô b', 'fòô bàř', 2, 3, 'UTF-8'), - array('', 'fòô bàř', 4, 0, 'UTF-8') - ); - } - - public function atProvider() - { - return array( - array('f', 'foo bar', 0), - array('o', 'foo bar', 1), - array('r', 'foo bar', 6), - array('', 'foo bar', 7), - array('f', 'fòô bàř', 0, 'UTF-8'), - array('ò', 'fòô bàř', 1, 'UTF-8'), - array('ř', 'fòô bàř', 6, 'UTF-8'), - array('', 'fòô bàř', 7, 'UTF-8'), - ); - } - - public function firstProvider() - { - return array( - array('', 'foo bar', -5), - array('', 'foo bar', 0), - array('f', 'foo bar', 1), - array('foo', 'foo bar', 3), - array('foo bar', 'foo bar', 7), - array('foo bar', 'foo bar', 8), - array('', 'fòô bàř', -5, 'UTF-8'), - array('', 'fòô bàř', 0, 'UTF-8'), - array('f', 'fòô bàř', 1, 'UTF-8'), - array('fòô', 'fòô bàř', 3, 'UTF-8'), - array('fòô bàř', 'fòô bàř', 7, 'UTF-8'), - array('fòô bàř', 'fòô bàř', 8, 'UTF-8'), - ); - } - - public function lastProvider() - { - return array( - array('', 'foo bar', -5), - array('', 'foo bar', 0), - array('r', 'foo bar', 1), - array('bar', 'foo bar', 3), - array('foo bar', 'foo bar', 7), - array('foo bar', 'foo bar', 8), - array('', 'fòô bàř', -5, 'UTF-8'), - array('', 'fòô bàř', 0, 'UTF-8'), - array('ř', 'fòô bàř', 1, 'UTF-8'), - array('bàř', 'fòô bàř', 3, 'UTF-8'), - array('fòô bàř', 'fòô bàř', 7, 'UTF-8'), - array('fòô bàř', 'fòô bàř', 8, 'UTF-8'), - ); - } - - public function ensureLeftProvider() - { - return array( - array('foobar', 'foobar', 'f'), - array('foobar', 'foobar', 'foo'), - array('foo/foobar', 'foobar', 'foo/'), - array('http://foobar', 'foobar', 'http://'), - array('http://foobar', 'http://foobar', 'http://'), - array('fòôbàř', 'fòôbàř', 'f', 'UTF-8'), - array('fòôbàř', 'fòôbàř', 'fòô', 'UTF-8'), - array('fòô/fòôbàř', 'fòôbàř', 'fòô/', 'UTF-8'), - array('http://fòôbàř', 'fòôbàř', 'http://', 'UTF-8'), - array('http://fòôbàř', 'http://fòôbàř', 'http://', 'UTF-8'), - ); - } - - public function ensureRightProvider() - { - return array( - array('foobar', 'foobar', 'r'), - array('foobar', 'foobar', 'bar'), - array('foobar/bar', 'foobar', '/bar'), - array('foobar.com/', 'foobar', '.com/'), - array('foobar.com/', 'foobar.com/', '.com/'), - array('fòôbàř', 'fòôbàř', 'ř', 'UTF-8'), - array('fòôbàř', 'fòôbàř', 'bàř', 'UTF-8'), - array('fòôbàř/bàř', 'fòôbàř', '/bàř', 'UTF-8'), - array('fòôbàř.com/', 'fòôbàř', '.com/', 'UTF-8'), - array('fòôbàř.com/', 'fòôbàř.com/', '.com/', 'UTF-8'), - ); - } - - public function removeLeftProvider() - { - return array( - array('foo bar', 'foo bar', ''), - array('oo bar', 'foo bar', 'f'), - array('bar', 'foo bar', 'foo '), - array('foo bar', 'foo bar', 'oo'), - array('foo bar', 'foo bar', 'oo bar'), - array('oo bar', 'foo bar', Stringy::create('foo bar')->first(1), 'UTF-8'), - array('oo bar', 'foo bar', Stringy::create('foo bar')->at(0), 'UTF-8'), - array('fòô bàř', 'fòô bàř', '', 'UTF-8'), - array('òô bàř', 'fòô bàř', 'f', 'UTF-8'), - array('bàř', 'fòô bàř', 'fòô ', 'UTF-8'), - array('fòô bàř', 'fòô bàř', 'òô', 'UTF-8'), - array('fòô bàř', 'fòô bàř', 'òô bàř', 'UTF-8') - ); - } - - public function removeRightProvider() - { - return array( - array('foo bar', 'foo bar', ''), - array('foo ba', 'foo bar', 'r'), - array('foo', 'foo bar', ' bar'), - array('foo bar', 'foo bar', 'ba'), - array('foo bar', 'foo bar', 'foo ba'), - array('foo ba', 'foo bar', Stringy::create('foo bar')->last(1), 'UTF-8'), - array('foo ba', 'foo bar', Stringy::create('foo bar')->at(6), 'UTF-8'), - array('fòô bàř', 'fòô bàř', '', 'UTF-8'), - array('fòô bà', 'fòô bàř', 'ř', 'UTF-8'), - array('fòô', 'fòô bàř', ' bàř', 'UTF-8'), - array('fòô bàř', 'fòô bàř', 'bà', 'UTF-8'), - array('fòô bàř', 'fòô bàř', 'fòô bà', 'UTF-8') - ); - } - - public function isAlphaProvider() - { - return array( - array(true, ''), - array(true, 'foobar'), - array(false, 'foo bar'), - array(false, 'foobar2'), - array(true, 'fòôbàř', 'UTF-8'), - array(false, 'fòô bàř', 'UTF-8'), - array(false, 'fòôbàř2', 'UTF-8'), - array(true, 'ҠѨњфгШ', 'UTF-8'), - array(false, 'ҠѨњ¨ˆфгШ', 'UTF-8'), - array(true, '丹尼爾', 'UTF-8') - ); - } - - public function isAlphanumericProvider() - { - return array( - array(true, ''), - array(true, 'foobar1'), - array(false, 'foo bar'), - array(false, 'foobar2"'), - array(false, "\nfoobar\n"), - array(true, 'fòôbàř1', 'UTF-8'), - array(false, 'fòô bàř', 'UTF-8'), - array(false, 'fòôbàř2"', 'UTF-8'), - array(true, 'ҠѨњфгШ', 'UTF-8'), - array(false, 'ҠѨњ¨ˆфгШ', 'UTF-8'), - array(true, '丹尼爾111', 'UTF-8'), - array(true, 'دانيال1', 'UTF-8'), - array(false, 'دانيال1 ', 'UTF-8') - ); - } - - public function isBlankProvider() - { - return array( - array(true, ''), - array(true, ' '), - array(true, "\n\t "), - array(true, "\n\t \v\f"), - array(false, "\n\t a \v\f"), - array(false, "\n\t ' \v\f"), - array(false, "\n\t 2 \v\f"), - array(true, '', 'UTF-8'), - array(true, ' ', 'UTF-8'), // no-break space (U+00A0) - array(true, '           ', 'UTF-8'), // spaces U+2000 to U+200A - array(true, ' ', 'UTF-8'), // narrow no-break space (U+202F) - array(true, ' ', 'UTF-8'), // medium mathematical space (U+205F) - array(true, ' ', 'UTF-8'), // ideographic space (U+3000) - array(false, ' z', 'UTF-8'), - array(false, ' 1', 'UTF-8'), - ); - } - - public function isJsonProvider() - { - return array( - array(true, ''), - array(true, '123'), - array(true, '{"foo": "bar"}'), - array(false, '{"foo":"bar",}'), - array(false, '{"foo"}'), - array(true, '["foo"]'), - array(false, '{"foo": "bar"]'), - array(true, '123', 'UTF-8'), - array(true, '{"fòô": "bàř"}', 'UTF-8'), - array(false, '{"fòô":"bàř",}', 'UTF-8'), - array(false, '{"fòô"}', 'UTF-8'), - array(false, '["fòô": "bàř"]', 'UTF-8'), - array(true, '["fòô"]', 'UTF-8'), - array(false, '{"fòô": "bàř"]', 'UTF-8'), - ); - } - - public function isLowerCaseProvider() - { - return array( - array(true, ''), - array(true, 'foobar'), - array(false, 'foo bar'), - array(false, 'Foobar'), - array(true, 'fòôbàř', 'UTF-8'), - array(false, 'fòôbàř2', 'UTF-8'), - array(false, 'fòô bàř', 'UTF-8'), - array(false, 'fòôbÀŘ', 'UTF-8'), - ); - } - - public function hasLowerCaseProvider() - { - return array( - array(false, ''), - array(true, 'foobar'), - array(false, 'FOO BAR'), - array(true, 'fOO BAR'), - array(true, 'foO BAR'), - array(true, 'FOO BAr'), - array(true, 'Foobar'), - array(false, 'FÒÔBÀŘ', 'UTF-8'), - array(true, 'fòôbàř', 'UTF-8'), - array(true, 'fòôbàř2', 'UTF-8'), - array(true, 'Fòô bàř', 'UTF-8'), - array(true, 'fòôbÀŘ', 'UTF-8'), - ); - } - - public function isSerializedProvider() - { - return array( - array(false, ''), - array(true, 'a:1:{s:3:"foo";s:3:"bar";}'), - array(false, 'a:1:{s:3:"foo";s:3:"bar"}'), - array(true, serialize(array('foo' => 'bar'))), - array(true, 'a:1:{s:5:"fòô";s:5:"bàř";}', 'UTF-8'), - array(false, 'a:1:{s:5:"fòô";s:5:"bàř"}', 'UTF-8'), - array(true, serialize(array('fòô' => 'bár')), 'UTF-8'), - ); - } - - public function isUpperCaseProvider() - { - return array( - array(true, ''), - array(true, 'FOOBAR'), - array(false, 'FOO BAR'), - array(false, 'fOOBAR'), - array(true, 'FÒÔBÀŘ', 'UTF-8'), - array(false, 'FÒÔBÀŘ2', 'UTF-8'), - array(false, 'FÒÔ BÀŘ', 'UTF-8'), - array(false, 'FÒÔBàř', 'UTF-8'), - ); - } - - public function hasUpperCaseProvider() - { - return array( - array(false, ''), - array(true, 'FOOBAR'), - array(false, 'foo bar'), - array(true, 'Foo bar'), - array(true, 'FOo bar'), - array(true, 'foo baR'), - array(true, 'fOOBAR'), - array(false, 'fòôbàř', 'UTF-8'), - array(true, 'FÒÔBÀŘ', 'UTF-8'), - array(true, 'FÒÔBÀŘ2', 'UTF-8'), - array(true, 'fÒÔ BÀŘ', 'UTF-8'), - array(true, 'FÒÔBàř', 'UTF-8'), - ); - } - - public function isHexadecimalProvider() - { - return array( - array(true, ''), - array(true, 'abcdef'), - array(true, 'ABCDEF'), - array(true, '0123456789'), - array(true, '0123456789AbCdEf'), - array(false, '0123456789x'), - array(false, 'ABCDEFx'), - array(true, 'abcdef', 'UTF-8'), - array(true, 'ABCDEF', 'UTF-8'), - array(true, '0123456789', 'UTF-8'), - array(true, '0123456789AbCdEf', 'UTF-8'), - array(false, '0123456789x', 'UTF-8'), - array(false, 'ABCDEFx', 'UTF-8'), - ); - } - - public function countSubstrProvider() - { - return array( - array(0, '', 'foo'), - array(0, 'foo', 'bar'), - array(1, 'foo bar', 'foo'), - array(2, 'foo bar', 'o'), - array(0, '', 'fòô', 'UTF-8'), - array(0, 'fòô', 'bàř', 'UTF-8'), - array(1, 'fòô bàř', 'fòô', 'UTF-8'), - array(2, 'fôòô bàř', 'ô', 'UTF-8'), - array(0, 'fÔÒÔ bàř', 'ô', 'UTF-8'), - array(0, 'foo', 'BAR', false), - array(1, 'foo bar', 'FOo', false), - array(2, 'foo bar', 'O', false), - array(1, 'fòô bàř', 'fÒÔ', false, 'UTF-8'), - array(2, 'fôòô bàř', 'Ô', false, 'UTF-8'), - array(2, 'συγγραφέας', 'Σ', false, 'UTF-8') - ); - } - - public function replaceProvider() - { - return array( - array('', '', '', ''), - array('foo', '', '', 'foo'), - array('foo', '\s', '\s', 'foo'), - array('foo bar', 'foo bar', '', ''), - array('foo bar', 'foo bar', 'f(o)o', '\1'), - array('\1 bar', 'foo bar', 'foo', '\1'), - array('bar', 'foo bar', 'foo ', ''), - array('far bar', 'foo bar', 'foo', 'far'), - array('bar bar', 'foo bar foo bar', 'foo ', ''), - array('', '', '', '', 'UTF-8'), - array('fòô', '', '', 'fòô', 'UTF-8'), - array('fòô', '\s', '\s', 'fòô', 'UTF-8'), - array('fòô bàř', 'fòô bàř', '', '', 'UTF-8'), - array('bàř', 'fòô bàř', 'fòô ', '', 'UTF-8'), - array('far bàř', 'fòô bàř', 'fòô', 'far', 'UTF-8'), - array('bàř bàř', 'fòô bàř fòô bàř', 'fòô ', '', 'UTF-8'), - ); - } - - public function regexReplaceProvider() - { - return array( - array('', '', '', ''), - array('bar', 'foo', 'f[o]+', 'bar'), - array('o bar', 'foo bar', 'f(o)o', '\1'), - array('bar', 'foo bar', 'f[O]+\s', '', 'i'), - array('foo', 'bar', '[[:alpha:]]{3}', 'foo'), - array('', '', '', '', 'msr', 'UTF-8'), - array('bàř', 'fòô ', 'f[òô]+\s', 'bàř', 'msr', 'UTF-8'), - array('fòô', 'bàř', '[[:alpha:]]{3}', 'fòô', 'msr', 'UTF-8') - ); - } - - public function htmlEncodeProvider() - { - return array( - array('&', '&'), - array('"', '"'), - array(''', "'", ENT_QUOTES), - array('<', '<'), - array('>', '>'), - ); - } - - public function htmlDecodeProvider() - { - return array( - array('&', '&'), - array('"', '"'), - array("'", ''', ENT_QUOTES), - array('<', '<'), - array('>', '>'), - ); - } -} diff --git a/application/vendor/danielstjules/stringy/tests/CreateTest.php b/application/vendor/danielstjules/stringy/tests/CreateTest.php deleted file mode 100644 index aef9c9f..0000000 --- a/application/vendor/danielstjules/stringy/tests/CreateTest.php +++ /dev/null @@ -1,16 +0,0 @@ -assertInstanceOf('Stringy\Stringy', $stringy); - $this->assertEquals('foo bar', (string) $stringy); - $this->assertEquals('UTF-8', $stringy->getEncoding()); - } -} diff --git a/application/vendor/danielstjules/stringy/tests/StaticStringyTest.php b/application/vendor/danielstjules/stringy/tests/StaticStringyTest.php deleted file mode 100644 index 5d17bc6..0000000 --- a/application/vendor/danielstjules/stringy/tests/StaticStringyTest.php +++ /dev/null @@ -1,710 +0,0 @@ -assertEquals($expected, $result); - } - - /** - * @dataProvider indexOfLastProvider() - */ - public function testIndexOfLast($expected, $str, $subStr, $offset = 0, $encoding = null) - { - $result = S::indexOfLast($str, $subStr, $offset, $encoding); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider charsProvider() - */ - public function testChars($expected, $str, $encoding = null) - { - $result = S::chars($str, $encoding); - $this->assertInternalType('array', $result); - foreach ($result as $char) { - $this->assertInternalType('string', $char); - } - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider upperCaseFirstProvider() - */ - public function testUpperCaseFirst($expected, $str, $encoding = null) - { - $result = S::upperCaseFirst($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider lowerCaseFirstProvider() - */ - public function testLowerCaseFirst($expected, $str, $encoding = null) - { - $result = S::lowerCaseFirst($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider camelizeProvider() - */ - public function testCamelize($expected, $str, $encoding = null) - { - $result = S::camelize($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider upperCamelizeProvider() - */ - public function testUpperCamelize($expected, $str, $encoding = null) - { - $result = S::upperCamelize($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider dasherizeProvider() - */ - public function testDasherize($expected, $str, $encoding = null) - { - $result = S::dasherize($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider underscoredProvider() - */ - public function testUnderscored($expected, $str, $encoding = null) - { - $result = S::underscored($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider swapCaseProvider() - */ - public function testSwapCase($expected, $str, $encoding = null) - { - $result = S::swapCase($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider titleizeProvider() - */ - public function testTitleize($expected, $str, $ignore = null, - $encoding = null) - { - $result = S::titleize($str, $ignore, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider humanizeProvider() - */ - public function testHumanize($expected, $str, $encoding = null) - { - $result = S::humanize($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider tidyProvider() - */ - public function testTidy($expected, $str) - { - $result = S::tidy($str); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider collapseWhitespaceProvider() - */ - public function testCollapseWhitespace($expected, $str, $encoding = null) - { - $result = S::collapseWhitespace($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider toAsciiProvider() - */ - public function testToAscii($expected, $str, $removeUnsupported = true) - { - $result = S::toAscii($str, $removeUnsupported); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider padProvider() - */ - public function testPad($expected, $str, $length, $padStr = ' ', - $padType = 'right', $encoding = null) - { - $result = S::pad($str, $length, $padStr, $padType, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testPadException() - { - $result = S::pad('string', 5, 'foo', 'bar'); - } - - /** - * @dataProvider padLeftProvider() - */ - public function testPadLeft($expected, $str, $length, $padStr = ' ', - $encoding = null) - { - $result = S::padLeft($str, $length, $padStr, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider padRightProvider() - */ - public function testPadRight($expected, $str, $length, $padStr = ' ', - $encoding = null) - { - $result = S::padRight($str, $length, $padStr, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider padBothProvider() - */ - public function testPadBoth($expected, $str, $length, $padStr = ' ', - $encoding = null) - { - $result = S::padBoth($str, $length, $padStr, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider startsWithProvider() - */ - public function testStartsWith($expected, $str, $substring, - $caseSensitive = true, $encoding = null) - { - $result = S::startsWith($str, $substring, $caseSensitive, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider endsWithProvider() - */ - public function testEndsWith($expected, $str, $substring, - $caseSensitive = true, $encoding = null) - { - $result = S::endsWith($str, $substring, $caseSensitive, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider toSpacesProvider() - */ - public function testToSpaces($expected, $str, $tabLength = 4) - { - $result = S::toSpaces($str, $tabLength); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider toTabsProvider() - */ - public function testToTabs($expected, $str, $tabLength = 4) - { - $result = S::toTabs($str, $tabLength); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider toLowerCaseProvider() - */ - public function testToLowerCase($expected, $str, $encoding = null) - { - $result = S::toLowerCase($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider toTitleCaseProvider() - */ - public function testToTitleCase($expected, $str, $encoding = null) - { - $result = S::toTitleCase($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider toUpperCaseProvider() - */ - public function testToUpperCase($expected, $str, $encoding = null) - { - $result = S::toUpperCase($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider slugifyProvider() - */ - public function testSlugify($expected, $str, $replacement = '-') - { - $result = S::slugify($str, $replacement); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider containsProvider() - */ - public function testContains($expected, $haystack, $needle, - $caseSensitive = true, $encoding = null) - { - $result = S::contains($haystack, $needle, $caseSensitive, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider containsAnyProvider() - */ - public function testcontainsAny($expected, $haystack, $needles, - $caseSensitive = true, $encoding = null) - { - $result = S::containsAny($haystack, $needles, $caseSensitive, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider containsAllProvider() - */ - public function testContainsAll($expected, $haystack, $needles, - $caseSensitive = true, $encoding = null) - { - $result = S::containsAll($haystack, $needles, $caseSensitive, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider surroundProvider() - */ - public function testSurround($expected, $str, $substring) - { - $result = S::surround($str, $substring); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider insertProvider() - */ - public function testInsert($expected, $str, $substring, $index, - $encoding = null) - { - $result = S::insert($str, $substring, $index, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider truncateProvider() - */ - public function testTruncate($expected, $str, $length, $substring = '', - $encoding = null) - { - $result = S::truncate($str, $length, $substring, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider safeTruncateProvider() - */ - public function testSafeTruncate($expected, $str, $length, $substring = '', - $encoding = null) - { - $result = S::safeTruncate($str, $length, $substring, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider reverseProvider() - */ - public function testReverse($expected, $str, $encoding = null) - { - $result = S::reverse($str, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider shuffleProvider() - */ - public function testShuffle($str, $encoding = null) - { - $result = S::shuffle($str, $encoding); - $encoding = $encoding ?: mb_internal_encoding(); - - $this->assertInternalType('string', $result); - $this->assertEquals(mb_strlen($str, $encoding), - mb_strlen($result, $encoding)); - - // We'll make sure that the chars are present after shuffle - for ($i = 0; $i < mb_strlen($str, $encoding); $i++) { - $char = mb_substr($str, $i, 1, $encoding); - $countBefore = mb_substr_count($str, $char, $encoding); - $countAfter = mb_substr_count($result, $char, $encoding); - $this->assertEquals($countBefore, $countAfter); - } - } - - /** - * @dataProvider trimProvider() - */ - public function testTrim($expected, $str, $chars = null, $encoding = null) - { - $result = S::trim($str, $chars, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider trimLeftProvider() - */ - public function testTrimLeft($expected, $str, $chars = null, - $encoding = null) - { - $result = S::trimLeft($str, $chars, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider trimRightProvider() - */ - public function testTrimRight($expected, $str, $chars = null, - $encoding = null) - { - $result = S::trimRight($str, $chars, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider longestCommonPrefixProvider() - */ - public function testLongestCommonPrefix($expected, $str, $otherStr, - $encoding = null) - { - $result = S::longestCommonPrefix($str, $otherStr, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider longestCommonSuffixProvider() - */ - public function testLongestCommonSuffix($expected, $str, $otherStr, - $encoding = null) - { - $result = S::longestCommonSuffix($str, $otherStr, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider longestCommonSubstringProvider() - */ - public function testLongestCommonSubstring($expected, $str, $otherStr, - $encoding = null) - { - $result = S::longestCommonSubstring($str, $otherStr, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider lengthProvider() - */ - public function testLength($expected, $str, $encoding = null) - { - $result = S::length($str, $encoding); - $this->assertEquals($expected, $result); - $this->assertInternalType('int', $result); - } - - /** - * @dataProvider substrProvider() - */ - public function testSubstr($expected, $str, $start, $length = null, - $encoding = null) - { - $result = S::substr($str, $start, $length, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider atProvider() - */ - public function testAt($expected, $str, $index, $encoding = null) - { - $result = S::at($str, $index, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider firstProvider() - */ - public function testFirst($expected, $str, $n, $encoding = null) - { - $result = S::first($str, $n, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider lastProvider() - */ - public function testLast($expected, $str, $n, $encoding = null) - { - $result = S::last($str, $n, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider ensureLeftProvider() - */ - public function testEnsureLeft($expected, $str, $substring, $encoding = null) - { - $result = S::ensureLeft($str, $substring, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider ensureRightProvider() - */ - public function testEnsureRight($expected, $str, $substring, $encoding = null) - { - $result = S::ensureRight($str, $substring, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider removeLeftProvider() - */ - public function testRemoveLeft($expected, $str, $substring, $encoding = null) - { - $result = S::removeLeft($str, $substring, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider removeRightProvider() - */ - public function testRemoveRight($expected, $str, $substring, $encoding = null) - { - $result = S::removeRight($str, $substring, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isAlphaProvider() - */ - public function testIsAlpha($expected, $str, $encoding = null) - { - $result = S::isAlpha($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isAlphanumericProvider() - */ - public function testIsAlphanumeric($expected, $str, $encoding = null) - { - $result = S::isAlphanumeric($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isBlankProvider() - */ - public function testIsBlank($expected, $str, $encoding = null) - { - $result = S::isBlank($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isJsonProvider() - */ - public function testIsJson($expected, $str, $encoding = null) - { - $result = S::isJson($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isLowerCaseProvider() - */ - public function testIsLowerCase($expected, $str, $encoding = null) - { - $result = S::isLowerCase($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider hasLowerCaseProvider() - */ - public function testHasLowerCase($expected, $str, $encoding = null) - { - $result = S::hasLowerCase($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isSerializedProvider() - */ - public function testIsSerialized($expected, $str, $encoding = null) - { - $result = S::isSerialized($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isUpperCaseProvider() - */ - public function testIsUpperCase($expected, $str, $encoding = null) - { - $result = S::isUpperCase($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider hasUpperCaseProvider() - */ - public function testHasUpperCase($expected, $str, $encoding = null) - { - $result = S::hasUpperCase($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider isHexadecimalProvider() - */ - public function testIsHexadecimal($expected, $str, $encoding = null) - { - $result = S::isHexadecimal($str, $encoding); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider countSubstrProvider() - */ - public function testCountSubstr($expected, $str, $substring, - $caseSensitive = true, $encoding = null) - { - $result = S::countSubstr($str, $substring, $caseSensitive, $encoding); - $this->assertInternalType('int', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider replaceProvider() - */ - public function testReplace($expected, $str, $search, $replacement, - $encoding = null) - { - $result = S::replace($str, $search, $replacement, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider regexReplaceProvider() - */ - public function testRegexReplace($expected, $str, $pattern, $replacement, - $options = 'msr', $encoding = null) - { - $result = S::regexReplace($str, $pattern, $replacement, $options, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider htmlEncodeProvider() - */ - public function testHtmlEncode($expected, $str, $flags = ENT_COMPAT, $encoding = null) - { - $result = S::htmlEncode($str, $flags, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider htmlDecodeProvider() - */ - public function testHtmlDecode($expected, $str, $flags = ENT_COMPAT, $encoding = null) - { - $result = S::htmlDecode($str, $flags, $encoding); - $this->assertInternalType('string', $result); - $this->assertEquals($expected, $result); - } -} diff --git a/application/vendor/danielstjules/stringy/tests/StringyTest.php b/application/vendor/danielstjules/stringy/tests/StringyTest.php deleted file mode 100644 index b5edc43..0000000 --- a/application/vendor/danielstjules/stringy/tests/StringyTest.php +++ /dev/null @@ -1,994 +0,0 @@ -assertStringy($stringy); - $this->assertEquals('foo bar', (string) $stringy); - $this->assertEquals('UTF-8', $stringy->getEncoding()); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testConstructWithArray() - { - (string) new S(array()); - $this->fail('Expecting exception when the constructor is passed an array'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testMissingToString() - { - (string) new S(new stdClass()); - $this->fail('Expecting exception when the constructor is passed an ' . - 'object without a __toString method'); - } - - /** - * @dataProvider toStringProvider() - */ - public function testToString($expected, $str) - { - $this->assertEquals($expected, (string) new S($str)); - } - - public function toStringProvider() - { - return array( - array('', null), - array('', false), - array('1', true), - array('-9', -9), - array('1.18', 1.18), - array(' string ', ' string ') - ); - } - - public function testCreate() - { - $stringy = S::create('foo bar', 'UTF-8'); - $this->assertStringy($stringy); - $this->assertEquals('foo bar', (string) $stringy); - $this->assertEquals('UTF-8', $stringy->getEncoding()); - } - - public function testChaining() - { - $stringy = S::create("Fòô Bàř", 'UTF-8'); - $this->assertStringy($stringy); - $result = $stringy->collapseWhitespace()->swapCase()->upperCaseFirst(); - $this->assertEquals('FÒÔ bÀŘ', $result); - } - - public function testCount() - { - $stringy = S::create('Fòô', 'UTF-8'); - $this->assertEquals(3, $stringy->count()); - $this->assertEquals(3, count($stringy)); - } - - public function testGetIterator() - { - $stringy = S::create('Fòô Bàř', 'UTF-8'); - - $valResult = array(); - foreach ($stringy as $char) { - $valResult[] = $char; - } - - $keyValResult = array(); - foreach ($stringy as $pos => $char) { - $keyValResult[$pos] = $char; - } - - $this->assertEquals(array('F', 'ò', 'ô', ' ', 'B', 'à', 'ř'), $valResult); - $this->assertEquals(array('F', 'ò', 'ô', ' ', 'B', 'à', 'ř'), $keyValResult); - } - - /** - * @dataProvider offsetExistsProvider() - */ - public function testOffsetExists($expected, $offset) - { - $stringy = S::create('fòô', 'UTF-8'); - $this->assertEquals($expected, $stringy->offsetExists($offset)); - $this->assertEquals($expected, isset($stringy[$offset])); - } - - public function offsetExistsProvider() - { - return array( - array(true, 0), - array(true, 2), - array(false, 3), - array(true, -1), - array(true, -3), - array(false, -4) - ); - } - - public function testOffsetGet() - { - $stringy = S::create('fòô', 'UTF-8'); - - $this->assertEquals('f', $stringy->offsetGet(0)); - $this->assertEquals('ô', $stringy->offsetGet(2)); - - $this->assertEquals('ô', $stringy[2]); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testOffsetGetOutOfBounds() - { - $stringy = S::create('fòô', 'UTF-8'); - $test = $stringy[3]; - } - - /** - * @expectedException \Exception - */ - public function testOffsetSet() - { - $stringy = S::create('fòô', 'UTF-8'); - $stringy[1] = 'invalid'; - } - - /** - * @expectedException \Exception - */ - public function testOffsetUnset() - { - $stringy = S::create('fòô', 'UTF-8'); - unset($stringy[1]); - } - - /** - * @dataProvider indexOfProvider() - */ - public function testIndexOf($expected, $str, $subStr, $offset = 0, $encoding = null) - { - $result = S::create($str, $encoding)->indexOf($subStr, $offset); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider indexOfLastProvider() - */ - public function testIndexOfLast($expected, $str, $subStr, $offset = 0, $encoding = null) - { - $result = S::create($str, $encoding)->indexOfLast($subStr, $offset); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider charsProvider() - */ - public function testChars($expected, $str, $encoding = null) - { - $result = S::create($str, $encoding)->chars(); - $this->assertInternalType('array', $result); - foreach ($result as $char) { - $this->assertInternalType('string', $char); - } - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider upperCaseFirstProvider() - */ - public function testUpperCaseFirst($expected, $str, $encoding = null) - { - $result = S::create($str, $encoding)->upperCaseFirst(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - } - - /** - * @dataProvider lowerCaseFirstProvider() - */ - public function testLowerCaseFirst($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->lowerCaseFirst(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider camelizeProvider() - */ - public function testCamelize($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->camelize(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider upperCamelizeProvider() - */ - public function testUpperCamelize($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->upperCamelize(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider dasherizeProvider() - */ - public function testDasherize($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->dasherize(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider underscoredProvider() - */ - public function testUnderscored($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->underscored(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider delimitProvider() - */ - public function testDelimit($expected, $str, $delimiter, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->delimit($delimiter); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider swapCaseProvider() - */ - public function testSwapCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->swapCase(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider titleizeProvider() - */ - public function testTitleize($expected, $str, $ignore = null, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->titleize($ignore); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider humanizeProvider() - */ - public function testHumanize($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->humanize(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider tidyProvider() - */ - public function testTidy($expected, $str) - { - $stringy = S::create($str); - $result = $stringy->tidy(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider collapseWhitespaceProvider() - */ - public function testCollapseWhitespace($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->collapseWhitespace(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider toAsciiProvider() - */ - public function testToAscii($expected, $str, $removeUnsupported = true) - { - $stringy = S::create($str); - $result = $stringy->toAscii($removeUnsupported); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider padProvider() - */ - public function testPad($expected, $str, $length, $padStr = ' ', - $padType = 'right', $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->pad($length, $padStr, $padType); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testPadException() - { - $stringy = S::create('foo'); - $result = $stringy->pad(5, 'foo', 'bar'); - } - - /** - * @dataProvider padLeftProvider() - */ - public function testPadLeft($expected, $str, $length, $padStr = ' ', - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->padLeft($length, $padStr); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider padRightProvider() - */ - public function testPadRight($expected, $str, $length, $padStr = ' ', - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->padRight($length, $padStr); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider padBothProvider() - */ - public function testPadBoth($expected, $str, $length, $padStr = ' ', - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->padBoth($length, $padStr); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider startsWithProvider() - */ - public function testStartsWith($expected, $str, $substring, - $caseSensitive = true, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->startsWith($substring, $caseSensitive); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider endsWithProvider() - */ - public function testEndsWith($expected, $str, $substring, - $caseSensitive = true, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->endsWith($substring, $caseSensitive); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider toSpacesProvider() - */ - public function testToSpaces($expected, $str, $tabLength = 4) - { - $stringy = S::create($str); - $result = $stringy->toSpaces($tabLength); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider toTabsProvider() - */ - public function testToTabs($expected, $str, $tabLength = 4) - { - $stringy = S::create($str); - $result = $stringy->toTabs($tabLength); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider toLowerCaseProvider() - */ - public function testToLowerCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->toLowerCase(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider toTitleCaseProvider() - */ - public function testToTitleCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->toTitleCase(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider toUpperCaseProvider() - */ - public function testToUpperCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->toUpperCase(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider slugifyProvider() - */ - public function testSlugify($expected, $str, $replacement = '-') - { - $stringy = S::create($str); - $result = $stringy->slugify($replacement); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider containsProvider() - */ - public function testContains($expected, $haystack, $needle, - $caseSensitive = true, $encoding = null) - { - $stringy = S::create($haystack, $encoding); - $result = $stringy->contains($needle, $caseSensitive); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($haystack, $stringy); - } - - /** - * @dataProvider containsAnyProvider() - */ - public function testcontainsAny($expected, $haystack, $needles, - $caseSensitive = true, $encoding = null) - { - $stringy = S::create($haystack, $encoding); - $result = $stringy->containsAny($needles, $caseSensitive); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($haystack, $stringy); - } - - /** - * @dataProvider containsAllProvider() - */ - public function testContainsAll($expected, $haystack, $needles, - $caseSensitive = true, $encoding = null) - { - $stringy = S::create($haystack, $encoding); - $result = $stringy->containsAll($needles, $caseSensitive); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($haystack, $stringy); - } - - /** - * @dataProvider surroundProvider() - */ - public function testSurround($expected, $str, $substring) - { - $stringy = S::create($str); - $result = $stringy->surround($substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider insertProvider() - */ - public function testInsert($expected, $str, $substring, $index, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->insert($substring, $index); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider truncateProvider() - */ - public function testTruncate($expected, $str, $length, $substring = '', - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->truncate($length, $substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider safeTruncateProvider() - */ - public function testSafeTruncate($expected, $str, $length, $substring = '', - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->safeTruncate($length, $substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider reverseProvider() - */ - public function testReverse($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->reverse(); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider shuffleProvider() - */ - public function testShuffle($str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $encoding = $encoding ?: mb_internal_encoding(); - $result = $stringy->shuffle(); - - $this->assertStringy($result); - $this->assertEquals($str, $stringy); - $this->assertEquals(mb_strlen($str, $encoding), - mb_strlen($result, $encoding)); - - // We'll make sure that the chars are present after shuffle - for ($i = 0; $i < mb_strlen($str, $encoding); $i++) { - $char = mb_substr($str, $i, 1, $encoding); - $countBefore = mb_substr_count($str, $char, $encoding); - $countAfter = mb_substr_count($result, $char, $encoding); - $this->assertEquals($countBefore, $countAfter); - } - } - - /** - * @dataProvider trimProvider() - */ - public function testTrim($expected, $str, $chars = null, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->trim($chars); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider trimLeftProvider() - */ - public function testTrimLeft($expected, $str, $chars = null, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->trimLeft($chars); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider trimRightProvider() - */ - public function testTrimRight($expected, $str, $chars = null, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->trimRight($chars); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider longestCommonPrefixProvider() - */ - public function testLongestCommonPrefix($expected, $str, $otherStr, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->longestCommonPrefix($otherStr); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider longestCommonSuffixProvider() - */ - public function testLongestCommonSuffix($expected, $str, $otherStr, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->longestCommonSuffix($otherStr); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider longestCommonSubstringProvider() - */ - public function testLongestCommonSubstring($expected, $str, $otherStr, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->longestCommonSubstring($otherStr); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider lengthProvider() - */ - public function testLength($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->length(); - $this->assertInternalType('int', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider substrProvider() - */ - public function testSubstr($expected, $str, $start, $length = null, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->substr($start, $length); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider atProvider() - */ - public function testAt($expected, $str, $index, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->at($index); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider firstProvider() - */ - public function testFirst($expected, $str, $n, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->first($n); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider lastProvider() - */ - public function testLast($expected, $str, $n, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->last($n); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider ensureLeftProvider() - */ - public function testEnsureLeft($expected, $str, $substring, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->ensureLeft($substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider ensureRightProvider() - */ - public function testEnsureRight($expected, $str, $substring, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->ensureRight($substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider removeLeftProvider() - */ - public function testRemoveLeft($expected, $str, $substring, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->removeLeft($substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider removeRightProvider() - */ - public function testRemoveRight($expected, $str, $substring, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->removeRight($substring); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isAlphaProvider() - */ - public function testIsAlpha($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isAlpha(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isAlphanumericProvider() - */ - public function testIsAlphanumeric($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isAlphanumeric(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isBlankProvider() - */ - public function testIsBlank($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isBlank(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isJsonProvider() - */ - public function testIsJson($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isJson(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isLowerCaseProvider() - */ - public function testIsLowerCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isLowerCase(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider hasLowerCaseProvider() - */ - public function testHasLowerCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->hasLowerCase(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isSerializedProvider() - */ - public function testIsSerialized($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isSerialized(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isUpperCaseProvider() - */ - public function testIsUpperCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isUpperCase(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider hasUpperCaseProvider() - */ - public function testHasUpperCase($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->hasUpperCase(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider isHexadecimalProvider() - */ - public function testIsHexadecimal($expected, $str, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->isHexadecimal(); - $this->assertInternalType('boolean', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider countSubstrProvider() - */ - public function testCountSubstr($expected, $str, $substring, - $caseSensitive = true, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->countSubstr($substring, $caseSensitive); - $this->assertInternalType('int', $result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider replaceProvider() - */ - public function testReplace($expected, $str, $search, $replacement, - $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->replace($search, $replacement); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider regexReplaceProvider() - */ - public function testregexReplace($expected, $str, $pattern, $replacement, - $options = 'msr', $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->regexReplace($pattern, $replacement, $options); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider htmlEncodeProvider() - */ - public function testHtmlEncode($expected, $str, $flags = ENT_COMPAT, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->htmlEncode($flags); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } - - /** - * @dataProvider htmlDecodeProvider() - */ - public function testHtmlDecode($expected, $str, $flags = ENT_COMPAT, $encoding = null) - { - $stringy = S::create($str, $encoding); - $result = $stringy->htmlDecode($flags); - $this->assertStringy($result); - $this->assertEquals($expected, $result); - $this->assertEquals($str, $stringy); - } -} diff --git a/application/vendor/doctrine/inflector/README.md b/application/vendor/doctrine/inflector/README.md index acb55a0..341f8b2 100644 --- a/application/vendor/doctrine/inflector/README.md +++ b/application/vendor/doctrine/inflector/README.md @@ -1,6 +1,8 @@ # Doctrine Inflector Doctrine Inflector is a small library that can perform string manipulations -with regard to upper-/lowercase and singular/plural forms of words. +with regard to uppercase/lowercase and singular/plural forms of words. -[![Build Status](https://travis-ci.org/doctrine/inflector.svg?branch=master)](https://travis-ci.org/doctrine/inflector) +[![Build Status](https://travis-ci.org/doctrine/inflector.svg)](https://travis-ci.org/doctrine/inflector) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/inflector/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/inflector/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/inflector/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/inflector/?branch=master) diff --git a/application/vendor/doctrine/inflector/composer.json b/application/vendor/doctrine/inflector/composer.json index 2189ff1..ab51ba0 100644 --- a/application/vendor/doctrine/inflector/composer.json +++ b/application/vendor/doctrine/inflector/composer.json @@ -1,9 +1,9 @@ { "name": "doctrine/inflector", "type": "library", - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "keywords": ["string", "inflection", "singularize", "pluralize"], - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "keywords": ["php", "strings", "words", "manipulation", "inflector", "inflection", "uppercase", "lowercase", "singular", "plural"], + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "license": "MIT", "authors": [ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, @@ -13,20 +13,30 @@ {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} ], "require": { - "php": "^7.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "doctrine/coding-standard": "^7.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "autoload": { - "psr-4": { "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector", + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } }, "autoload-dev": { - "psr-4": { "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector" } + "psr-4": { + "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector", + "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" + } }, "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/application/vendor/doctrine/inflector/docs/en/index.rst b/application/vendor/doctrine/inflector/docs/en/index.rst new file mode 100644 index 0000000..29866f4 --- /dev/null +++ b/application/vendor/doctrine/inflector/docs/en/index.rst @@ -0,0 +1,226 @@ +Introduction +============ + +The Doctrine Inflector has methods for inflecting text. The features include pluralization, +singularization, converting between camelCase and under_score and capitalizing +words. + +Installation +============ + +You can install the Inflector with composer: + +.. code-block:: console + + $ composer require doctrine/inflector + +Usage +===== + +Using the inflector is easy, you can create a new ``Doctrine\Inflector\Inflector`` instance by using +the ``Doctrine\Inflector\InflectorFactory`` class: + +.. code-block:: php + + use Doctrine\Inflector\InflectorFactory; + + $inflector = InflectorFactory::create()->build(); + +By default it will create an English inflector. If you want to use another language, just pass the language +you want to create an inflector for to the ``createForLanguage()`` method: + +.. code-block:: php + + use Doctrine\Inflector\InflectorFactory; + use Doctrine\Inflector\Language; + + $inflector = InflectorFactory::createForLanguage(Language::SPANISH)->build(); + +The supported languages are as follows: + +- ``Language::ENGLISH`` +- ``Language::FRENCH`` +- ``Language::NORWEGIAN_BOKMAL`` +- ``Language::PORTUGUESE`` +- ``Language::SPANISH`` +- ``Language::TURKISH`` + +If you want to manually construct the inflector instead of using a factory, you can do so like this: + +.. code-block:: php + + use Doctrine\Inflector\CachedWordInflector; + use Doctrine\Inflector\RulesetInflector; + use Doctrine\Inflector\Rules\English; + + $inflector = new Inflector( + new CachedWordInflector(new RulesetInflector( + English\Rules::getSingularRuleset() + )), + new CachedWordInflector(new RulesetInflector( + English\Rules::getPluralRuleset() + )) + ); + +Adding Languages +---------------- + +If you are interested in adding support for your language, take a look at the other languages defined in the +``Doctrine\Inflector\Rules`` namespace and the tests located in ``Doctrine\Tests\Inflector\Rules``. You can copy +one of the languages and update the rules for your language. + +Once you have done this, send a pull request to the ``doctrine/inflector`` repository with the additions. + +Custom Setup +============ + +If you want to setup custom singular and plural rules, you can configure these in the factory: + +.. code-block:: php + + use Doctrine\Inflector\InflectorFactory; + use Doctrine\Inflector\Rules\Pattern; + use Doctrine\Inflector\Rules\Patterns; + use Doctrine\Inflector\Rules\Ruleset; + use Doctrine\Inflector\Rules\Substitution; + use Doctrine\Inflector\Rules\Substitutions; + use Doctrine\Inflector\Rules\Transformation; + use Doctrine\Inflector\Rules\Transformations; + use Doctrine\Inflector\Rules\Word; + + $inflector = InflectorFactory::create() + ->withSingularRules( + new Ruleset( + new Transformations( + new Transformation(new Pattern('/^(bil)er$/i'), '\1'), + new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '\1ta') + ), + new Patterns(new Pattern('singulars')), + new Substitutions(new Substitution(new Word('spins'), new Word('spinor'))) + ) + ) + ->withPluralRules( + new Ruleset( + new Transformations( + new Transformation(new Pattern('^(bil)er$'), '\1'), + new Transformation(new Pattern('^(inflec|contribu)tors$'), '\1ta') + ), + new Patterns(new Pattern('noflect'), new Pattern('abtuse')), + new Substitutions( + new Substitution(new Word('amaze'), new Word('amazable')), + new Substitution(new Word('phone'), new Word('phonezes')) + ) + ) + ) + ->build(); + +No operation inflector +---------------------- + +The ``Doctrine\Inflector\NoopWordInflector`` may be used to configure an inflector that doesn't perform any operation for +pluralization and/or singularization. If will simply return the input as output. + +This is an implementation of the `Null Object design pattern `_. + +.. code-block:: php + + use Doctrine\Inflector\Inflector; + use Doctrine\Inflector\NoopWordInflector; + + $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); + +Tableize +======== + +Converts ``ModelName`` to ``model_name``: + +.. code-block:: php + + echo $inflector->tableize('ModelName'); // model_name + +Classify +======== + +Converts ``model_name`` to ``ModelName``: + +.. code-block:: php + + echo $inflector->classify('model_name'); // ModelName + +Camelize +======== + +This method uses `Classify`_ and then converts the first character to lowercase: + +.. code-block:: php + + echo $inflector->camelize('model_name'); // modelName + +Capitalize +========== + +Takes a string and capitalizes all of the words, like PHP's built-in +``ucwords`` function. This extends that behavior, however, by allowing the +word delimiters to be configured, rather than only separating on +whitespace. + +Here is an example: + +.. code-block:: php + + $string = 'top-o-the-morning to all_of_you!'; + + echo $inflector->capitalize($string); // Top-O-The-Morning To All_of_you! + + echo $inflector->capitalize($string, '-_ '); // Top-O-The-Morning To All_Of_You! + +Pluralize +========= + +Returns a word in plural form. + +.. code-block:: php + + echo $inflector->pluralize('browser'); // browsers + +Singularize +=========== + +Returns a word in singular form. + +.. code-block:: php + + echo $inflector->singularize('browsers'); // browser + +Urlize +====== + +Generate a URL friendly string from a string of text: + +.. code-block:: php + + echo $inflector->urlize('My first blog post'); // my-first-blog-post + +Unaccent +======== + +You can unaccent a string of text using the ``unaccent()`` method: + +.. code-block:: php + + echo $inflector->unaccent('año'); // ano + +Legacy API +========== + +The API present in Inflector 1.x is still available, but will be deprecated in a future release and dropped for 3.0. +Support for languages other than English is available in the 2.0 API only. + +Acknowledgements +================ + +The language rules in this library have been adapted from several different sources, including but not limited to: + +- `Ruby On Rails Inflector `_ +- `ICanBoogie Inflector `_ +- `CakePHP Inflector `_ diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php b/application/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php index f9067a0..d00e565 100644 --- a/application/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php @@ -19,252 +19,67 @@ namespace Doctrine\Common\Inflector; +use Doctrine\Inflector\Inflector as InflectorObject; +use Doctrine\Inflector\InflectorFactory; +use Doctrine\Inflector\LanguageInflectorFactory; +use Doctrine\Inflector\Rules\Pattern; +use Doctrine\Inflector\Rules\Patterns; +use Doctrine\Inflector\Rules\Ruleset; +use Doctrine\Inflector\Rules\Substitution; +use Doctrine\Inflector\Rules\Substitutions; +use Doctrine\Inflector\Rules\Transformation; +use Doctrine\Inflector\Rules\Transformations; +use Doctrine\Inflector\Rules\Word; +use InvalidArgumentException; +use function array_keys; +use function array_map; +use function array_unshift; +use function array_values; +use function sprintf; +use function trigger_error; +use const E_USER_DEPRECATED; + /** - * Doctrine inflector has static methods for inflecting text. - * - * The methods in these classes are from several different sources collected - * across several different php projects and several different authors. The - * original author names and emails are not known. - * - * Pluralize & Singularize implementation are borrowed from CakePHP with some modifications. - * - * @link www.doctrine-project.org - * @since 1.0 - * @author Konsta Vesterinen - * @author Jonathan H. Wage + * @deprecated */ class Inflector { /** - * Plural inflector rules. - * - * @var string[][] + * @var LanguageInflectorFactory|null */ - private static $plural = array( - 'rules' => array( - '/(s)tatus$/i' => '\1\2tatuses', - '/(quiz)$/i' => '\1zes', - '/^(ox)$/i' => '\1\2en', - '/([m|l])ouse$/i' => '\1ice', - '/(matr|vert|ind)(ix|ex)$/i' => '\1ices', - '/(x|ch|ss|sh)$/i' => '\1es', - '/([^aeiouy]|qu)y$/i' => '\1ies', - '/(hive|gulf)$/i' => '\1s', - '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', - '/sis$/i' => 'ses', - '/([ti])um$/i' => '\1a', - '/(c)riterion$/i' => '\1riteria', - '/(p)erson$/i' => '\1eople', - '/(m)an$/i' => '\1en', - '/(c)hild$/i' => '\1hildren', - '/(f)oot$/i' => '\1eet', - '/(buffal|her|potat|tomat|volcan)o$/i' => '\1\2oes', - '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i', - '/us$/i' => 'uses', - '/(alias)$/i' => '\1es', - '/(analys|ax|cris|test|thes)is$/i' => '\1es', - '/s$/' => 's', - '/^$/' => '', - '/$/' => 's', - ), - 'uninflected' => array( - '.*[nrlm]ese', - '.*deer', - '.*fish', - '.*measles', - '.*ois', - '.*pox', - '.*sheep', - 'people', - 'cookie', - 'police', - ), - 'irregular' => array( - 'atlas' => 'atlases', - 'axe' => 'axes', - 'beef' => 'beefs', - 'brother' => 'brothers', - 'cafe' => 'cafes', - 'chateau' => 'chateaux', - 'niveau' => 'niveaux', - 'child' => 'children', - 'cookie' => 'cookies', - 'corpus' => 'corpuses', - 'cow' => 'cows', - 'criterion' => 'criteria', - 'curriculum' => 'curricula', - 'demo' => 'demos', - 'domino' => 'dominoes', - 'echo' => 'echoes', - 'foot' => 'feet', - 'fungus' => 'fungi', - 'ganglion' => 'ganglions', - 'genie' => 'genies', - 'genus' => 'genera', - 'goose' => 'geese', - 'graffito' => 'graffiti', - 'hippopotamus' => 'hippopotami', - 'hoof' => 'hoofs', - 'human' => 'humans', - 'iris' => 'irises', - 'larva' => 'larvae', - 'leaf' => 'leaves', - 'loaf' => 'loaves', - 'man' => 'men', - 'medium' => 'media', - 'memorandum' => 'memoranda', - 'money' => 'monies', - 'mongoose' => 'mongooses', - 'motto' => 'mottoes', - 'move' => 'moves', - 'mythos' => 'mythoi', - 'niche' => 'niches', - 'nucleus' => 'nuclei', - 'numen' => 'numina', - 'occiput' => 'occiputs', - 'octopus' => 'octopuses', - 'opus' => 'opuses', - 'ox' => 'oxen', - 'passerby' => 'passersby', - 'penis' => 'penises', - 'person' => 'people', - 'plateau' => 'plateaux', - 'runner-up' => 'runners-up', - 'sex' => 'sexes', - 'soliloquy' => 'soliloquies', - 'son-in-law' => 'sons-in-law', - 'syllabus' => 'syllabi', - 'testis' => 'testes', - 'thief' => 'thieves', - 'tooth' => 'teeth', - 'tornado' => 'tornadoes', - 'trilby' => 'trilbys', - 'turf' => 'turfs', - 'valve' => 'valves', - 'volcano' => 'volcanoes', - ) - ); + private static $factory; - /** - * Singular inflector rules. - * - * @var string[][] - */ - private static $singular = array( - 'rules' => array( - '/(s)tatuses$/i' => '\1\2tatus', - '/^(.*)(menu)s$/i' => '\1\2', - '/(quiz)zes$/i' => '\\1', - '/(matr)ices$/i' => '\1ix', - '/(vert|ind)ices$/i' => '\1ex', - '/^(ox)en/i' => '\1', - '/(alias)(es)*$/i' => '\1', - '/(buffal|her|potat|tomat|volcan)oes$/i' => '\1o', - '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us', - '/([ftw]ax)es/i' => '\1', - '/(analys|ax|cris|test|thes)es$/i' => '\1is', - '/(shoe|slave)s$/i' => '\1', - '/(o)es$/i' => '\1', - '/ouses$/' => 'ouse', - '/([^a])uses$/' => '\1us', - '/([m|l])ice$/i' => '\1ouse', - '/(x|ch|ss|sh)es$/i' => '\1', - '/(m)ovies$/i' => '\1\2ovie', - '/(s)eries$/i' => '\1\2eries', - '/([^aeiouy]|qu)ies$/i' => '\1y', - '/([lr])ves$/i' => '\1f', - '/(tive)s$/i' => '\1', - '/(hive)s$/i' => '\1', - '/(drive)s$/i' => '\1', - '/(dive)s$/i' => '\1', - '/(olive)s$/i' => '\1', - '/([^fo])ves$/i' => '\1fe', - '/(^analy)ses$/i' => '\1sis', - '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', - '/(c)riteria$/i' => '\1riterion', - '/([ti])a$/i' => '\1um', - '/(p)eople$/i' => '\1\2erson', - '/(m)en$/i' => '\1an', - '/(c)hildren$/i' => '\1\2hild', - '/(f)eet$/i' => '\1oot', - '/(n)ews$/i' => '\1\2ews', - '/eaus$/' => 'eau', - '/^(.*us)$/' => '\\1', - '/s$/i' => '', - ), - 'uninflected' => array( - '.*[nrlm]ese', - '.*deer', - '.*fish', - '.*measles', - '.*ois', - '.*pox', - '.*sheep', - '.*ss', - 'data', - 'police', - 'pants', - 'clothes', - ), - 'irregular' => array( - 'abuses' => 'abuse', - 'avalanches' => 'avalanche', - 'caches' => 'cache', - 'criteria' => 'criterion', - 'curves' => 'curve', - 'emphases' => 'emphasis', - 'foes' => 'foe', - 'geese' => 'goose', - 'graves' => 'grave', - 'hoaxes' => 'hoax', - 'media' => 'medium', - 'neuroses' => 'neurosis', - 'waves' => 'wave', - 'oases' => 'oasis', - 'valves' => 'valve', - ) - ); + /** @var InflectorObject|null */ + private static $instance; - /** - * Words that should not be inflected. - * - * @var array - */ - private static $uninflected = array( - '.*?media', 'Amoyese', 'audio', 'bison', 'Borghese', 'bream', 'breeches', - 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'compensation', 'Congoese', - 'contretemps', 'coreopsis', 'corps', 'data', 'debris', 'deer', 'diabetes', 'djinn', 'education', 'eland', - 'elk', 'emoji', 'equipment', 'evidence', 'Faroese', 'feedback', 'fish', 'flounder', 'Foochowese', - 'Furniture', 'furniture', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'gold', - 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', 'jackanapes', 'jedi', - 'Kiplingese', 'knowledge', 'Kongoese', 'love', 'Lucchese', 'Luggage', 'mackerel', 'Maltese', 'metadata', - 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', 'nutrition', 'offspring', - 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'plankton', 'pliers', 'pokemon', 'police', 'Portuguese', - 'proceedings', 'rabies', 'rain', 'rhinoceros', 'rice', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', - 'series', 'Shavese', 'shears', 'sheep', 'siemens', 'species', 'staff', 'swine', 'traffic', - 'trousers', 'trout', 'tuna', 'us', 'Vermontese', 'Wenchowese', 'wheat', 'whiting', 'wildebeest', 'Yengeese' - ); + private static function getInstance() : InflectorObject + { + if (self::$factory === null) { + self::$factory = self::createFactory(); + } - /** - * Method cache array. - * - * @var array - */ - private static $cache = array(); + if (self::$instance === null) { + self::$instance = self::$factory->build(); + } - /** - * The initial state of Inflector so reset() works. - * - * @var array - */ - private static $initialState = array(); + return self::$instance; + } + + private static function createFactory() : LanguageInflectorFactory + { + return InflectorFactory::create(); + } /** * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. + * + * @deprecated */ public static function tableize(string $word) : string { - return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word)); + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); + + return self::getInstance()->tableize($word); } /** @@ -272,23 +87,29 @@ public static function tableize(string $word) : string */ public static function classify(string $word) : string { - return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); + + return self::getInstance()->classify($word); } /** * Camelizes a word. This uses the classify() method and turns the first character to lowercase. + * + * @deprecated */ public static function camelize(string $word) : string { - return lcfirst(self::classify($word)); + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); + + return self::getInstance()->camelize($word); } /** - * Uppercases words with configurable delimeters between words. + * Uppercases words with configurable delimiters between words. * * Takes a string and capitalizes all of the words, like PHP's built-in * ucwords function. This extends that behavior, however, by allowing the - * word delimeters to be configured, rather than only separating on + * word delimiters to be configured, rather than only separating on * whitespace. * * Here is an example: @@ -306,30 +127,29 @@ public static function camelize(string $word) : string * @param string $string The string to operate on. * @param string $delimiters A list of word separators. * - * @return string The string with all delimeter-separated words capitalized. + * @return string The string with all delimiter-separated words capitalized. + * + * @deprecated */ public static function ucwords(string $string, string $delimiters = " \n\t\r\0\x0B-") : string { + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please use the "ucwords" function instead.', __METHOD__), E_USER_DEPRECATED); + return ucwords($string, $delimiters); } /** * Clears Inflectors inflected value caches, and resets the inflection * rules to the initial values. + * + * @deprecated */ public static function reset() : void { - if (empty(self::$initialState)) { - self::$initialState = get_class_vars('Inflector'); - - return; - } + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); - foreach (self::$initialState as $key => $val) { - if ($key !== 'initialState') { - self::${$key} = $val; - } - } + self::$factory = null; + self::$instance = null; } /** @@ -352,36 +172,79 @@ public static function reset() : void * new rules that are being defined in $rules. * * @return void + * + * @deprecated */ public static function rules(string $type, iterable $rules, bool $reset = false) : void { - foreach ($rules as $rule => $pattern) { - if ( ! is_array($pattern)) { - continue; - } + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); - if ($reset) { - self::${$type}[$rule] = $pattern; - } else { - self::${$type}[$rule] = ($rule === 'uninflected') - ? array_merge($pattern, self::${$type}[$rule]) - : $pattern + self::${$type}[$rule]; - } + if (self::$factory === null) { + self::$factory = self::createFactory(); + } - unset($rules[$rule], self::${$type}['cache' . ucfirst($rule)]); + self::$instance = null; + + switch ($type) { + case 'singular': + self::$factory->withSingularRules(self::buildRuleset($rules), $reset); + break; + case 'plural': + self::$factory->withPluralRules(self::buildRuleset($rules), $reset); + break; + default: + throw new InvalidArgumentException(sprintf('Cannot define custom inflection rules for type "%s".', $type)); + } + } + + private static function buildRuleset(iterable $rules) : Ruleset + { + $regular = []; + $irregular = []; + $uninflected = []; + + foreach ($rules as $rule => $pattern) { + if ( ! is_array($pattern)) { + $regular[$rule] = $pattern; - if (isset(self::${$type}['merged'][$rule])) { - unset(self::${$type}['merged'][$rule]); + continue; } - if ($type === 'plural') { - self::$cache['pluralize'] = self::$cache['tableize'] = array(); - } elseif ($type === 'singular') { - self::$cache['singularize'] = array(); + switch ($rule) { + case 'uninflected': + $uninflected = $pattern; + break; + case 'irregular': + $irregular = $pattern; + break; + case 'rules': + $regular = $pattern; + break; } } - self::${$type}['rules'] = $rules + self::${$type}['rules']; + return new Ruleset( + new Transformations(...array_map( + static function (string $pattern, string $replacement) : Transformation { + return new Transformation(new Pattern($pattern), $replacement); + }, + array_keys($regular), + array_values($regular) + )), + new Patterns(...array_map( + static function (string $pattern) : Pattern { + return new Pattern($pattern); + }, + $uninflected + )), + new Substitutions(...array_map( + static function (string $word, string $to) : Substitution { + return new Substitution(new Word($word), new Word($to)); + }, + array_keys($irregular), + array_values($irregular) + )) + ); } /** @@ -390,45 +253,14 @@ public static function rules(string $type, iterable $rules, bool $reset = false) * @param string $word The word in singular form. * * @return string The word in plural form. + * + * @deprecated */ public static function pluralize(string $word) : string { - if (isset(self::$cache['pluralize'][$word])) { - return self::$cache['pluralize'][$word]; - } - - if (!isset(self::$plural['merged']['irregular'])) { - self::$plural['merged']['irregular'] = self::$plural['irregular']; - } - - if (!isset(self::$plural['merged']['uninflected'])) { - self::$plural['merged']['uninflected'] = array_merge(self::$plural['uninflected'], self::$uninflected); - } - - if (!isset(self::$plural['cacheUninflected']) || !isset(self::$plural['cacheIrregular'])) { - self::$plural['cacheUninflected'] = '(?:' . implode('|', self::$plural['merged']['uninflected']) . ')'; - self::$plural['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$plural['merged']['irregular'])) . ')'; - } - - if (preg_match('/(.*)\\b(' . self::$plural['cacheIrregular'] . ')$/i', $word, $regs)) { - self::$cache['pluralize'][$word] = $regs[1] . $word[0] . substr(self::$plural['merged']['irregular'][strtolower($regs[2])], 1); - - return self::$cache['pluralize'][$word]; - } - - if (preg_match('/^(' . self::$plural['cacheUninflected'] . ')$/i', $word, $regs)) { - self::$cache['pluralize'][$word] = $word; - - return $word; - } - - foreach (self::$plural['rules'] as $rule => $replacement) { - if (preg_match($rule, $word)) { - self::$cache['pluralize'][$word] = preg_replace($rule, $replacement, $word); + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); - return self::$cache['pluralize'][$word]; - } - } + return self::getInstance()->pluralize($word); } /** @@ -437,54 +269,13 @@ public static function pluralize(string $word) : string * @param string $word The word in plural form. * * @return string The word in singular form. + * + * @deprecated */ public static function singularize(string $word) : string { - if (isset(self::$cache['singularize'][$word])) { - return self::$cache['singularize'][$word]; - } - - if (!isset(self::$singular['merged']['uninflected'])) { - self::$singular['merged']['uninflected'] = array_merge( - self::$singular['uninflected'], - self::$uninflected - ); - } - - if (!isset(self::$singular['merged']['irregular'])) { - self::$singular['merged']['irregular'] = array_merge( - self::$singular['irregular'], - array_flip(self::$plural['irregular']) - ); - } - - if (!isset(self::$singular['cacheUninflected']) || !isset(self::$singular['cacheIrregular'])) { - self::$singular['cacheUninflected'] = '(?:' . implode('|', self::$singular['merged']['uninflected']) . ')'; - self::$singular['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$singular['merged']['irregular'])) . ')'; - } - - if (preg_match('/(.*)\\b(' . self::$singular['cacheIrregular'] . ')$/i', $word, $regs)) { - self::$cache['singularize'][$word] = $regs[1] . $word[0] . substr(self::$singular['merged']['irregular'][strtolower($regs[2])], 1); - - return self::$cache['singularize'][$word]; - } - - if (preg_match('/^(' . self::$singular['cacheUninflected'] . ')$/i', $word, $regs)) { - self::$cache['singularize'][$word] = $word; - - return $word; - } - - foreach (self::$singular['rules'] as $rule => $replacement) { - if (preg_match($rule, $word)) { - self::$cache['singularize'][$word] = preg_replace($rule, $replacement, $word); - - return self::$cache['singularize'][$word]; - } - } - - self::$cache['singularize'][$word] = $word; + @trigger_error(sprintf('The "%s" method is deprecated and will be dropped in doctrine/inflector 2.0. Please update to the new Inflector API.', __METHOD__), E_USER_DEPRECATED); - return $word; + return self::getInstance()->singularize($word); } } diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php new file mode 100644 index 0000000..b59ac46 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php @@ -0,0 +1,24 @@ +wordInflector = $wordInflector; + } + + public function inflect(string $word) : string + { + return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php new file mode 100644 index 0000000..1b15061 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/GenericLanguageInflectorFactory.php @@ -0,0 +1,65 @@ +singularRulesets[] = $this->getSingularRuleset(); + $this->pluralRulesets[] = $this->getPluralRuleset(); + } + + final public function build() : Inflector + { + return new Inflector( + new CachedWordInflector(new RulesetInflector( + ...$this->singularRulesets + )), + new CachedWordInflector(new RulesetInflector( + ...$this->pluralRulesets + )) + ); + } + + final public function withSingularRules(?Ruleset $singularRules, bool $reset = false) : LanguageInflectorFactory + { + if ($reset) { + $this->singularRulesets = []; + } + + if ($singularRules instanceof Ruleset) { + array_unshift($this->singularRulesets, $singularRules); + } + + return $this; + } + + final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false) : LanguageInflectorFactory + { + if ($reset) { + $this->pluralRulesets = []; + } + + if ($pluralRules instanceof Ruleset) { + array_unshift($this->pluralRulesets, $pluralRules); + } + + return $this; + } + + abstract protected function getSingularRuleset() : Ruleset; + + abstract protected function getPluralRuleset() : Ruleset; +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php new file mode 100644 index 0000000..2411918 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Inflector.php @@ -0,0 +1,506 @@ + 'A', + 'Á' => 'A', + 'Â' => 'A', + 'Ã' => 'A', + 'Ä' => 'Ae', + 'Æ' => 'Ae', + 'Å' => 'Aa', + 'æ' => 'a', + 'Ç' => 'C', + 'È' => 'E', + 'É' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ì' => 'I', + 'Í' => 'I', + 'Î' => 'I', + 'Ï' => 'I', + 'Ñ' => 'N', + 'Ò' => 'O', + 'Ó' => 'O', + 'Ô' => 'O', + 'Õ' => 'O', + 'Ö' => 'Oe', + 'Ù' => 'U', + 'Ú' => 'U', + 'Û' => 'U', + 'Ü' => 'Ue', + 'Ý' => 'Y', + 'ß' => 'ss', + 'à' => 'a', + 'á' => 'a', + 'â' => 'a', + 'ã' => 'a', + 'ä' => 'ae', + 'å' => 'aa', + 'ç' => 'c', + 'è' => 'e', + 'é' => 'e', + 'ê' => 'e', + 'ë' => 'e', + 'ì' => 'i', + 'í' => 'i', + 'î' => 'i', + 'ï' => 'i', + 'ñ' => 'n', + 'ò' => 'o', + 'ó' => 'o', + 'ô' => 'o', + 'õ' => 'o', + 'ö' => 'oe', + 'ù' => 'u', + 'ú' => 'u', + 'û' => 'u', + 'ü' => 'ue', + 'ý' => 'y', + 'ÿ' => 'y', + 'Ā' => 'A', + 'ā' => 'a', + 'Ă' => 'A', + 'ă' => 'a', + 'Ą' => 'A', + 'ą' => 'a', + 'Ć' => 'C', + 'ć' => 'c', + 'Ĉ' => 'C', + 'ĉ' => 'c', + 'Ċ' => 'C', + 'ċ' => 'c', + 'Č' => 'C', + 'č' => 'c', + 'Ď' => 'D', + 'ď' => 'd', + 'Đ' => 'D', + 'đ' => 'd', + 'Ē' => 'E', + 'ē' => 'e', + 'Ĕ' => 'E', + 'ĕ' => 'e', + 'Ė' => 'E', + 'ė' => 'e', + 'Ę' => 'E', + 'ę' => 'e', + 'Ě' => 'E', + 'ě' => 'e', + 'Ĝ' => 'G', + 'ĝ' => 'g', + 'Ğ' => 'G', + 'ğ' => 'g', + 'Ġ' => 'G', + 'ġ' => 'g', + 'Ģ' => 'G', + 'ģ' => 'g', + 'Ĥ' => 'H', + 'ĥ' => 'h', + 'Ħ' => 'H', + 'ħ' => 'h', + 'Ĩ' => 'I', + 'ĩ' => 'i', + 'Ī' => 'I', + 'ī' => 'i', + 'Ĭ' => 'I', + 'ĭ' => 'i', + 'Į' => 'I', + 'į' => 'i', + 'İ' => 'I', + 'ı' => 'i', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'Ĵ' => 'J', + 'ĵ' => 'j', + 'Ķ' => 'K', + 'ķ' => 'k', + 'ĸ' => 'k', + 'Ĺ' => 'L', + 'ĺ' => 'l', + 'Ļ' => 'L', + 'ļ' => 'l', + 'Ľ' => 'L', + 'ľ' => 'l', + 'Ŀ' => 'L', + 'ŀ' => 'l', + 'Ł' => 'L', + 'ł' => 'l', + 'Ń' => 'N', + 'ń' => 'n', + 'Ņ' => 'N', + 'ņ' => 'n', + 'Ň' => 'N', + 'ň' => 'n', + 'ʼn' => 'N', + 'Ŋ' => 'n', + 'ŋ' => 'N', + 'Ō' => 'O', + 'ō' => 'o', + 'Ŏ' => 'O', + 'ŏ' => 'o', + 'Ő' => 'O', + 'ő' => 'o', + 'Œ' => 'OE', + 'œ' => 'oe', + 'Ø' => 'O', + 'ø' => 'o', + 'Ŕ' => 'R', + 'ŕ' => 'r', + 'Ŗ' => 'R', + 'ŗ' => 'r', + 'Ř' => 'R', + 'ř' => 'r', + 'Ś' => 'S', + 'ś' => 's', + 'Ŝ' => 'S', + 'ŝ' => 's', + 'Ş' => 'S', + 'ş' => 's', + 'Š' => 'S', + 'š' => 's', + 'Ţ' => 'T', + 'ţ' => 't', + 'Ť' => 'T', + 'ť' => 't', + 'Ŧ' => 'T', + 'ŧ' => 't', + 'Ũ' => 'U', + 'ũ' => 'u', + 'Ū' => 'U', + 'ū' => 'u', + 'Ŭ' => 'U', + 'ŭ' => 'u', + 'Ů' => 'U', + 'ů' => 'u', + 'Ű' => 'U', + 'ű' => 'u', + 'Ų' => 'U', + 'ų' => 'u', + 'Ŵ' => 'W', + 'ŵ' => 'w', + 'Ŷ' => 'Y', + 'ŷ' => 'y', + 'Ÿ' => 'Y', + 'Ź' => 'Z', + 'ź' => 'z', + 'Ż' => 'Z', + 'ż' => 'z', + 'Ž' => 'Z', + 'ž' => 'z', + 'ſ' => 's', + '€' => 'E', + '£' => '', + ]; + + /** @var WordInflector */ + private $singularizer; + + /** @var WordInflector */ + private $pluralizer; + + public function __construct(WordInflector $singularizer, WordInflector $pluralizer) + { + $this->singularizer = $singularizer; + $this->pluralizer = $pluralizer; + } + + /** + * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. + */ + public function tableize(string $word) : string + { + $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); + + if ($tableized === null) { + throw new RuntimeException(sprintf( + 'preg_replace returned null for value "%s"', + $word + )); + } + + return mb_strtolower($tableized); + } + + /** + * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. + */ + public function classify(string $word) : string + { + return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); + } + + /** + * Camelizes a word. This uses the classify() method and turns the first character to lowercase. + */ + public function camelize(string $word) : string + { + return lcfirst($this->classify($word)); + } + + /** + * Uppercases words with configurable delimiters between words. + * + * Takes a string and capitalizes all of the words, like PHP's built-in + * ucwords function. This extends that behavior, however, by allowing the + * word delimiters to be configured, rather than only separating on + * whitespace. + * + * Here is an example: + * + * capitalize($string); + * // Top-O-The-Morning To All_of_you! + * + * echo $inflector->capitalize($string, '-_ '); + * // Top-O-The-Morning To All_Of_You! + * ?> + * + * + * @param string $string The string to operate on. + * @param string $delimiters A list of word separators. + * + * @return string The string with all delimiter-separated words capitalized. + */ + public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-") : string + { + return ucwords($string, $delimiters); + } + + /** + * Checks if the given string seems like it has utf8 characters in it. + * + * @param string $string The string to check for utf8 characters in. + */ + public function seemsUtf8(string $string) : bool + { + for ($i = 0; $i < strlen($string); $i++) { + if (ord($string[$i]) < 0x80) { + continue; // 0bbbbbbb + } + + if ((ord($string[$i]) & 0xE0) === 0xC0) { + $n = 1; // 110bbbbb + } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { + $n = 2; // 1110bbbb + } elseif ((ord($string[$i]) & 0xF8) === 0xF0) { + $n = 3; // 11110bbb + } elseif ((ord($string[$i]) & 0xFC) === 0xF8) { + $n = 4; // 111110bb + } elseif ((ord($string[$i]) & 0xFE) === 0xFC) { + $n = 5; // 1111110b + } else { + return false; // Does not match any model + } + + for ($j = 0; $j < $n; $j++) { // n bytes matching 10bbbbbb follow ? + if (++$i === strlen($string) || ((ord($string[$i]) & 0xC0) !== 0x80)) { + return false; + } + } + } + + return true; + } + + /** + * Remove any illegal characters, accents, etc. + * + * @param string $string String to unaccent + * + * @return string Unaccented string + */ + public function unaccent(string $string) : string + { + if (preg_match('/[\x80-\xff]/', $string) === false) { + return $string; + } + + if ($this->seemsUtf8($string)) { + $string = strtr($string, self::ACCENTED_CHARACTERS); + } else { + $characters = []; + + // Assume ISO-8859-1 if not UTF-8 + $characters['in'] = + chr(128) + . chr(131) + . chr(138) + . chr(142) + . chr(154) + . chr(158) + . chr(159) + . chr(162) + . chr(165) + . chr(181) + . chr(192) + . chr(193) + . chr(194) + . chr(195) + . chr(196) + . chr(197) + . chr(199) + . chr(200) + . chr(201) + . chr(202) + . chr(203) + . chr(204) + . chr(205) + . chr(206) + . chr(207) + . chr(209) + . chr(210) + . chr(211) + . chr(212) + . chr(213) + . chr(214) + . chr(216) + . chr(217) + . chr(218) + . chr(219) + . chr(220) + . chr(221) + . chr(224) + . chr(225) + . chr(226) + . chr(227) + . chr(228) + . chr(229) + . chr(231) + . chr(232) + . chr(233) + . chr(234) + . chr(235) + . chr(236) + . chr(237) + . chr(238) + . chr(239) + . chr(241) + . chr(242) + . chr(243) + . chr(244) + . chr(245) + . chr(246) + . chr(248) + . chr(249) + . chr(250) + . chr(251) + . chr(252) + . chr(253) + . chr(255); + + $characters['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'; + + $string = strtr($string, $characters['in'], $characters['out']); + + $doubleChars = []; + + $doubleChars['in'] = [ + chr(140), + chr(156), + chr(198), + chr(208), + chr(222), + chr(223), + chr(230), + chr(240), + chr(254), + ]; + + $doubleChars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th']; + + $string = str_replace($doubleChars['in'], $doubleChars['out'], $string); + } + + return $string; + } + + /** + * Convert any passed string to a url friendly string. + * Converts 'My first blog post' to 'my-first-blog-post' + * + * @param string $string String to urlize. + * + * @return string Urlized string. + */ + public function urlize(string $string) : string + { + // Remove all non url friendly characters with the unaccent function + $unaccented = $this->unaccent($string); + + if (function_exists('mb_strtolower')) { + $lowered = mb_strtolower($unaccented); + } else { + $lowered = strtolower($unaccented); + } + + $replacements = [ + '/\W/' => ' ', + '/([A-Z]+)([A-Z][a-z])/' => '\1_\2', + '/([a-z\d])([A-Z])/' => '\1_\2', + '/[^A-Z^a-z^0-9^\/]+/' => '-', + ]; + + $urlized = $lowered; + + foreach ($replacements as $pattern => $replacement) { + $replaced = preg_replace($pattern, $replacement, $urlized); + + if ($replaced === null) { + throw new RuntimeException(sprintf( + 'preg_replace returned null for value "%s"', + $urlized + )); + } + + $urlized = $replaced; + } + + return trim($urlized, '-'); + } + + /** + * Returns a word in singular form. + * + * @param string $word The word in plural form. + * + * @return string The word in singular form. + */ + public function singularize(string $word) : string + { + return $this->singularizer->inflect($word); + } + + /** + * Returns a word in plural form. + * + * @param string $word The word in singular form. + * + * @return string The word in plural form. + */ + public function pluralize(string $word) : string + { + return $this->pluralizer->inflect($word); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php new file mode 100644 index 0000000..44bba5d --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/InflectorFactory.php @@ -0,0 +1,45 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset() : Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php new file mode 100644 index 0000000..be37a97 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Uninflected.php @@ -0,0 +1,193 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset() : Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php new file mode 100644 index 0000000..2fdc020 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/French/Uninflected.php @@ -0,0 +1,34 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset() : Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php new file mode 100644 index 0000000..c6b9fc7 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/NorwegianBokmal/Uninflected.php @@ -0,0 +1,36 @@ +pattern = $pattern; + + if (isset($this->pattern[0]) && $this->pattern[0] === '/') { + $this->regex = $this->pattern; + } else { + $this->regex = '/' . $this->pattern . '/i'; + } + } + + public function getPattern() : string + { + return $this->pattern; + } + + public function getRegex() : string + { + return $this->regex; + } + + public function matches(string $word) : bool + { + return preg_match($this->getRegex(), $word) === 1; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php new file mode 100644 index 0000000..a71f1ed --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Patterns.php @@ -0,0 +1,34 @@ +patterns = $patterns; + + $patterns = array_map(static function (Pattern $pattern) : string { + return $pattern->getPattern(); + }, $this->patterns); + + $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; + } + + public function matches(string $word) : bool + { + return preg_match($this->regex, $word, $regs) === 1; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php new file mode 100644 index 0000000..155055f --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Inflectible.php @@ -0,0 +1,104 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset() : Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php new file mode 100644 index 0000000..52360c4 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Portuguese/Uninflected.php @@ -0,0 +1,38 @@ +regular = $regular; + $this->uninflected = $uninflected; + $this->irregular = $irregular; + } + + public function getRegular() : Transformations + { + return $this->regular; + } + + public function getUninflected() : Patterns + { + return $this->uninflected; + } + + public function getIrregular() : Substitutions + { + return $this->irregular; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php new file mode 100644 index 0000000..6cace86 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Inflectible.php @@ -0,0 +1,53 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset() : Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php new file mode 100644 index 0000000..b13281e --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Spanish/Uninflected.php @@ -0,0 +1,36 @@ +from = $from; + $this->to = $to; + } + + public function getFrom() : Word + { + return $this->from; + } + + public function getTo() : Word + { + return $this->to; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php new file mode 100644 index 0000000..24cc34a --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Substitutions.php @@ -0,0 +1,56 @@ +substitutions[$substitution->getFrom()->getWord()] = $substitution; + } + } + + public function getFlippedSubstitutions() : Substitutions + { + $substitutions = []; + + foreach ($this->substitutions as $substitution) { + $substitutions[] = new Substitution( + $substitution->getTo(), + $substitution->getFrom() + ); + } + + return new Substitutions(...$substitutions); + } + + public function inflect(string $word) : string + { + $lowerWord = strtolower($word); + + if (isset($this->substitutions[$lowerWord])) { + $firstLetterUppercase = $lowerWord[0] !== $word[0]; + + $toWord = $this->substitutions[$lowerWord]->getTo()->getWord(); + + if ($firstLetterUppercase) { + return strtoupper($toWord[0]) . substr($toWord, 1); + } + + return $toWord; + } + + return $word; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php new file mode 100644 index 0000000..84ef08b --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformation.php @@ -0,0 +1,38 @@ +pattern = $pattern; + $this->replacement = $replacement; + } + + public function getPattern() : Pattern + { + return $this->pattern; + } + + public function getReplacement() : string + { + return $this->replacement; + } + + public function inflect(string $word) : string + { + return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php new file mode 100644 index 0000000..9f4724e --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Transformations.php @@ -0,0 +1,29 @@ +transformations = $transformations; + } + + public function inflect(string $word) : string + { + foreach ($this->transformations as $transformation) { + if ($transformation->getPattern()->matches($word)) { + return $transformation->inflect($word); + } + } + + return $word; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php new file mode 100644 index 0000000..74900cb --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Inflectible.php @@ -0,0 +1,40 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset() : Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php new file mode 100644 index 0000000..c95ccbf --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/Turkish/Uninflected.php @@ -0,0 +1,36 @@ +word = $word; + } + + public function getWord() : string + { + return $this->word; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php new file mode 100644 index 0000000..0e3a5eb --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/RulesetInflector.php @@ -0,0 +1,55 @@ +rulesets = array_merge([$ruleset], $rulesets); + } + + public function inflect(string $word) : string + { + if ($word === '') { + return ''; + } + + foreach ($this->rulesets as $ruleset) { + if ($ruleset->getUninflected()->matches($word)) { + return $word; + } + + $inflected = $ruleset->getIrregular()->inflect($word); + + if ($inflected !== $word) { + return $inflected; + } + + $inflected = $ruleset->getRegular()->inflect($word); + + if ($inflected !== $word) { + return $inflected; + } + } + + return $word; + } +} diff --git a/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php new file mode 100644 index 0000000..f257055 --- /dev/null +++ b/application/vendor/doctrine/inflector/lib/Doctrine/Inflector/WordInflector.php @@ -0,0 +1,10 @@ +io = $io; } + public function deactivate(Composer $composer, IOInterface $io) + { + // Not needed + } + + public function uninstall(Composer $composer, IOInterface $io) + { + // Not needed + } + public static function getSubscribedEvents() { return array( diff --git a/application/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php b/application/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php index 3d3f0c0..02fbfe8 100644 --- a/application/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php +++ b/application/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php @@ -110,19 +110,25 @@ protected static function checkFileHelpers($file, $event, IOInterface $io, $comp foreach ($subClasses as $class) { try { static::checkHelper($event, $io, $composer, $class); - } catch (InvalidArgumentException $e) { - $io->writeError($e instanceof NotUpdateInterfaceInstanceException - ? 'UpdateHelper error in '.$file.":\n".JsonFile::encode($class).' is not an instance of UpdateHelperInterface.' - : 'UpdateHelper error: '.$e->getPrevious()->getMessage(). - "\nFile: ".$e->getPrevious()->getFile(). - "\nLine:".$e->getPrevious()->getLine(). - "\n\n".$e->getPrevious()->getTraceAsString() - ); + } catch (InvalidArgumentException $exception) { + $io->writeError(static::getErrorMessage($exception, $file, $class)); continue; } } } + protected static function getErrorMessage(InvalidArgumentException $exception, $file, $class) + { + if ($exception instanceof NotUpdateInterfaceInstanceException) { + return 'UpdateHelper error in '.$file.":\n".JsonFile::encode($class).' is not an instance of UpdateHelperInterface.'; + } + + return 'UpdateHelper error: '.$exception->getPrevious()->getMessage(). + "\nFile: ".$exception->getPrevious()->getFile(). + "\nLine:".$exception->getPrevious()->getLine(). + "\n\n".$exception->getPrevious()->getTraceAsString(); + } + public static function check(Event $event) { if (!($event instanceof ScriptEvent) && !($event instanceof PackageEvent)) { diff --git a/application/vendor/laravel/framework/composer.json b/application/vendor/laravel/framework/composer.json index 9fac93e..af7f2b3 100644 --- a/application/vendor/laravel/framework/composer.json +++ b/application/vendor/laravel/framework/composer.json @@ -18,34 +18,32 @@ "php": ">=5.5.9", "ext-mbstring": "*", "ext-openssl": "*", - "classpreloader/classpreloader": "~2.0|~3.0", - "danielstjules/stringy": "~1.8", + "classpreloader/classpreloader": "~3.0", "doctrine/inflector": "~1.0", - "jeremeamia/superclosure": "~2.0", + "jeremeamia/superclosure": "~2.2", "league/flysystem": "~1.0", "monolog/monolog": "~1.11", "mtdowling/cron-expression": "~1.0", - "nesbot/carbon": "~1.19", + "nesbot/carbon": "~1.20", "paragonie/random_compat": "~1.4", "psy/psysh": "0.7.*", "swiftmailer/swiftmailer": "~5.1", - "symfony/console": "2.7.*", - "symfony/css-selector": "2.7.*|2.8.*", - "symfony/debug": "2.7.*", - "symfony/dom-crawler": "2.7.*", - "symfony/finder": "2.7.*", - "symfony/http-foundation": "2.7.*", - "symfony/http-kernel": "2.7.*", - "symfony/process": "2.7.*", - "symfony/routing": "2.7.*", - "symfony/translation": "2.7.*", - "symfony/var-dumper": "2.7.*", - "vlucas/phpdotenv": "~1.0" + "symfony/console": "2.8.*|3.0.*", + "symfony/debug": "2.8.*|3.0.*", + "symfony/finder": "2.8.*|3.0.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/http-kernel": "2.8.*|3.0.*", + "symfony/polyfill-php56": "~1.0", + "symfony/process": "2.8.*|3.0.*", + "symfony/routing": "2.8.*|3.0.*", + "symfony/translation": "2.8.*|3.0.*", + "symfony/var-dumper": "2.8.*|3.0.*", + "vlucas/phpdotenv": "~2.2" }, "replace": { "illuminate/auth": "self.version", - "illuminate/bus": "self.version", "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", "illuminate/cache": "self.version", "illuminate/config": "self.version", "illuminate/console": "self.version", @@ -70,15 +68,17 @@ "illuminate/support": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "tightenco/collect": "self.version" }, "require-dev": { "aws/aws-sdk-php": "~3.0", - "iron-io/iron_mq": "~2.0", "mockery/mockery": "~0.9.4", "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~4.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "~4.1", + "predis/predis": "~1.0", + "symfony/css-selector": "2.8.*|3.0.*", + "symfony/dom-crawler": "2.8.*|3.0.*" }, "autoload": { "classmap": [ @@ -94,7 +94,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { @@ -102,13 +102,14 @@ "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", - "iron-io/iron_mq": "Required to use the iron queue driver (~2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." + "symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/readme.md b/application/vendor/laravel/framework/readme.md index 4500a7b..76d266f 100644 --- a/application/vendor/laravel/framework/readme.md +++ b/application/vendor/laravel/framework/readme.md @@ -1,4 +1,4 @@ -## Laravel Framework (Kernel) +# Laravel Framework (Kernel) [![StyleCI](https://styleci.io/repos/7548986/shield?style=flat)](https://styleci.io/repos/7548986) [![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) @@ -27,6 +27,6 @@ Thank you for considering contributing to the Laravel framework! The contributio If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. -### License +## License The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Access/UnauthorizedException.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php similarity index 59% rename from application/vendor/laravel/framework/src/Illuminate/Auth/Access/UnauthorizedException.php rename to application/vendor/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php index 7488c5b..dc0753e 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Access/UnauthorizedException.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Access/AuthorizationException.php @@ -4,7 +4,7 @@ use Exception; -class UnauthorizedException extends Exception +class AuthorizationException extends Exception { // } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php index de057d6..7b07f75 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php @@ -98,7 +98,7 @@ public function define($ability, $callback) { if (is_callable($callback)) { $this->abilities[$ability] = $callback; - } elseif (is_string($callback) && str_contains($callback, '@')) { + } elseif (is_string($callback) && Str::contains($callback, '@')) { $this->abilities[$ability] = $this->buildAbilityCallback($callback); } else { throw new InvalidArgumentException("Callback must be a callable or a 'Class@method' string."); @@ -197,7 +197,7 @@ public function check($ability, $arguments = []) { try { $result = $this->raw($ability, $arguments); - } catch (UnauthorizedException $e) { + } catch (AuthorizationException $e) { return false; } @@ -211,7 +211,7 @@ public function check($ability, $arguments = []) * @param array|mixed $arguments * @return \Illuminate\Auth\Access\Response * - * @throws \Illuminate\Auth\Access\UnauthorizedException + * @throws \Illuminate\Auth\Access\AuthorizationException */ public function authorize($ability, $arguments = []) { @@ -279,7 +279,7 @@ protected function callAuthCallback($user, $ability, array $arguments) */ protected function callBeforeCallbacks($user, $ability, array $arguments) { - $arguments = array_merge([$user, $ability], $arguments); + $arguments = array_merge([$user, $ability], [$arguments]); foreach ($this->beforeCallbacks as $before) { if (! is_null($result = call_user_func_array($before, $arguments))) { @@ -299,7 +299,7 @@ protected function callBeforeCallbacks($user, $ability, array $arguments) */ protected function callAfterCallbacks($user, $ability, array $arguments, $result) { - $arguments = array_merge([$user, $ability, $result], $arguments); + $arguments = array_merge([$user, $ability, $result], [$arguments]); foreach ($this->afterCallbacks as $after) { call_user_func_array($after, $arguments); @@ -369,7 +369,7 @@ protected function resolvePolicyCallback($user, $ability, array $arguments) [$instance, 'before'], $beforeArguments ); - // If we recieved a non-null result from the before method, we will return it + // If we received a non-null result from the before method, we will return it // as the result of a check. This allows developers to override the checks // in the policy and return a result for all rules defined in the class. if (! is_null($result)) { @@ -424,7 +424,7 @@ public function resolvePolicy($class) } /** - * Get a guard instance for the given user. + * Get a gate instance for the given user. * * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user * @return static diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php index 148b584..1a597bb 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php @@ -21,10 +21,10 @@ protected function allow($message = null) * @param string $message * @return void * - * @throws \Illuminate\Auth\Access\UnauthorizedException + * @throws \Illuminate\Auth\Access\AuthorizationException */ protected function deny($message = 'This action is unauthorized.') { - throw new UnauthorizedException($message); + throw new AuthorizationException($message); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php b/application/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php old mode 100644 new mode 100755 index 96129f8..10a2610 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php @@ -2,20 +2,127 @@ namespace Illuminate\Auth; -use Illuminate\Support\Manager; -use Illuminate\Contracts\Auth\Guard as GuardContract; +use Closure; +use InvalidArgumentException; +use Illuminate\Contracts\Auth\Factory as FactoryContract; -class AuthManager extends Manager +class AuthManager implements FactoryContract { + use CreatesUserProviders; + /** - * Create a new driver instance. + * The application instance. * - * @param string $driver + * @var \Illuminate\Foundation\Application + */ + protected $app; + + /** + * The registered custom driver creators. + * + * @var array + */ + protected $customCreators = []; + + /** + * The array of created "drivers". + * + * @var array + */ + protected $guards = []; + + /** + * The user resolver shared by various services. + * + * Determines the default user for Gate, Request, and the Authenticatable contract. + * + * @var \Closure + */ + protected $userResolver; + + /** + * Create a new Auth manager instance. + * + * @param \Illuminate\Foundation\Application $app + * @return void + */ + public function __construct($app) + { + $this->app = $app; + + $this->userResolver = function ($guard = null) { + return $this->guard($guard)->user(); + }; + } + + /** + * Attempt to get the guard from the local cache. + * + * @param string $name + * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard + */ + public function guard($name = null) + { + $name = $name ?: $this->getDefaultDriver(); + + return isset($this->guards[$name]) + ? $this->guards[$name] + : $this->guards[$name] = $this->resolve($name); + } + + /** + * Resolve the given guard. + * + * @param string $name + * @return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard + * + * @throws \InvalidArgumentException + */ + protected function resolve($name) + { + $config = $this->getConfig($name); + + if (is_null($config)) { + throw new InvalidArgumentException("Auth guard [{$name}] is not defined."); + } + + if (isset($this->customCreators[$config['driver']])) { + return $this->callCustomCreator($name, $config); + } else { + $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; + + if (method_exists($this, $driverMethod)) { + return $this->{$driverMethod}($name, $config); + } else { + throw new InvalidArgumentException("Auth guard driver [{$name}] is not defined."); + } + } + } + + /** + * Call a custom driver creator. + * + * @param string $name + * @param array $config * @return mixed */ - protected function createDriver($driver) + protected function callCustomCreator($name, array $config) { - $guard = parent::createDriver($driver); + return $this->customCreators[$config['driver']]($this->app, $name, $config); + } + + /** + * Create a session based authentication guard. + * + * @param string $name + * @param array $config + * @return \Illuminate\Auth\SessionGuard + */ + public function createSessionDriver($name, $config) + { + $provider = $this->createUserProvider($config['provider']); + + $guard = new SessionGuard($name, $provider, $this->app['session.store']); // When using the remember me functionality of the authentication services we // will need to be set the encryption instance of the guard, which allows @@ -36,93 +143,152 @@ protected function createDriver($driver) } /** - * Call a custom driver creator. + * Create a token based authentication guard. * - * @param string $driver - * @return \Illuminate\Contracts\Auth\Guard + * @param string $name + * @param array $config + * @return \Illuminate\Auth\TokenGuard */ - protected function callCustomCreator($driver) + public function createTokenDriver($name, $config) { - $custom = parent::callCustomCreator($driver); + // The token guard implements a basic API token based guard implementation + // that takes an API token field from the request and matches it to the + // user in the database or another persistence layer where users are. + $guard = new TokenGuard( + $this->createUserProvider($config['provider']), + $this->app['request'] + ); - if ($custom instanceof GuardContract) { - return $custom; - } + $this->app->refresh('request', $guard, 'setRequest'); - return new Guard($custom, $this->app['session.store']); + return $guard; } /** - * Create an instance of the database driver. + * Get the guard configuration. * - * @return \Illuminate\Auth\Guard + * @param string $name + * @return array */ - public function createDatabaseDriver() + protected function getConfig($name) { - $provider = $this->createDatabaseProvider(); + return $this->app['config']["auth.guards.{$name}"]; + } - return new Guard($provider, $this->app['session.store']); + /** + * Get the default authentication driver name. + * + * @return string + */ + public function getDefaultDriver() + { + return $this->app['config']['auth.defaults.guard']; } /** - * Create an instance of the database user provider. + * Set the default guard driver the factory should serve. * - * @return \Illuminate\Auth\DatabaseUserProvider + * @param string $name + * @return void */ - protected function createDatabaseProvider() + public function shouldUse($name) { - $connection = $this->app['db']->connection(); + $this->setDefaultDriver($name); - // When using the basic database user provider, we need to inject the table we - // want to use, since this is not an Eloquent model we will have no way to - // know without telling the provider, so we'll inject the config value. - $table = $this->app['config']['auth.table']; + $this->userResolver = function ($name = null) { + return $this->guard($name)->user(); + }; + } - return new DatabaseUserProvider($connection, $this->app['hash'], $table); + /** + * Set the default authentication driver name. + * + * @param string $name + * @return void + */ + public function setDefaultDriver($name) + { + $this->app['config']['auth.defaults.guard'] = $name; } /** - * Create an instance of the Eloquent driver. + * Register a new callback based request guard. * - * @return \Illuminate\Auth\Guard + * @param string $driver + * @param callable $callback + * @return $this */ - public function createEloquentDriver() + public function viaRequest($driver, callable $callback) { - $provider = $this->createEloquentProvider(); + return $this->extend($driver, function () use ($callback) { + $guard = new RequestGuard($callback, $this->app['request']); + + $this->app->refresh('request', $guard, 'setRequest'); - return new Guard($provider, $this->app['session.store']); + return $guard; + }); } /** - * Create an instance of the Eloquent user provider. + * Get the user resolver callback. * - * @return \Illuminate\Auth\EloquentUserProvider + * @return \Closure */ - protected function createEloquentProvider() + public function userResolver() { - $model = $this->app['config']['auth.model']; + return $this->userResolver; + } - return new EloquentUserProvider($this->app['hash'], $model); + /** + * Set the callback to be used to resolve users. + * + * @param \Closure $userResolver + * @return $this + */ + public function resolveUsersUsing(Closure $userResolver) + { + $this->userResolver = $userResolver; + + return $this; } /** - * Get the default authentication driver name. + * Register a custom driver creator Closure. * - * @return string + * @param string $driver + * @param \Closure $callback + * @return $this */ - public function getDefaultDriver() + public function extend($driver, Closure $callback) { - return $this->app['config']['auth.driver']; + $this->customCreators[$driver] = $callback; + + return $this; } /** - * Set the default authentication driver name. + * Register a custom provider creator Closure. * * @param string $name - * @return void + * @param \Closure $callback + * @return $this */ - public function setDefaultDriver($name) + public function provider($name, Closure $callback) + { + $this->customProviderCreators[$name] = $callback; + + return $this; + } + + /** + * Dynamically call the default driver instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) { - $this->app['config']['auth.driver'] = $name; + return call_user_func_array([$this->guard(), $method], $parameters); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php old mode 100644 new mode 100755 index 9ef8041..2820beb --- a/application/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php @@ -42,7 +42,7 @@ protected function registerAuthenticator() }); $this->app->singleton('auth.driver', function ($app) { - return $app['auth']->driver(); + return $app['auth']->guard(); }); } @@ -53,9 +53,11 @@ protected function registerAuthenticator() */ protected function registerUserResolver() { - $this->app->bind(AuthenticatableContract::class, function ($app) { - return $app['auth']->user(); - }); + $this->app->bind( + AuthenticatableContract::class, function ($app) { + return call_user_func($app['auth']->userResolver()); + } + ); } /** @@ -67,7 +69,7 @@ protected function registerAccessGate() { $this->app->singleton(GateContract::class, function ($app) { return new Gate($app, function () use ($app) { - return $app['auth']->user(); + return call_user_func($app['auth']->userResolver()); }); }); } @@ -80,8 +82,8 @@ protected function registerAccessGate() protected function registerRequestRebindHandler() { $this->app->rebinding('request', function ($app, $request) { - $request->setUserResolver(function () use ($app) { - return $app['auth']->user(); + $request->setUserResolver(function ($guard = null) use ($app) { + return call_user_func($app['auth']->userResolver(), $guard); }); }); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php index 46101d2..ae55d8f 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Authenticatable.php @@ -4,6 +4,16 @@ trait Authenticatable { + /** + * Get the name of the unique identifier for the user. + * + * @return string + */ + public function getAuthIdentifierName() + { + return $this->getKeyName(); + } + /** * Get the unique identifier for the user. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/AuthenticationException.php b/application/vendor/laravel/framework/src/Illuminate/Auth/AuthenticationException.php new file mode 100644 index 0000000..142afd1 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/AuthenticationException.php @@ -0,0 +1,37 @@ +guard = $guard; + + parent::__construct('Unauthenticated.'); + } + + /** + * Get the guard instance. + * + * @return \Illuminate\Contracts\Auth\Guard|null + */ + public function guard() + { + return $this->guard; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php index 88dcb8c..320e934 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php @@ -7,11 +7,11 @@ class ClearResetsCommand extends Command { /** - * The console command name. + * The name and signature of the console command. * * @var string */ - protected $name = 'auth:clear-resets'; + protected $signature = 'auth:clear-resets {name? : The name of the password broker}'; /** * The console command description. @@ -27,7 +27,7 @@ class ClearResetsCommand extends Command */ public function fire() { - $this->laravel['auth.password.tokens']->deleteExpired(); + $this->laravel['auth.password']->broker($this->argument('name'))->getRepository()->deleteExpired(); $this->info('Expired reset tokens cleared!'); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/MakeAuthCommand.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/MakeAuthCommand.php new file mode 100644 index 0000000..d7de893 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/MakeAuthCommand.php @@ -0,0 +1,122 @@ + 'auth/login.blade.php', + 'auth/register.stub' => 'auth/register.blade.php', + 'auth/passwords/email.stub' => 'auth/passwords/email.blade.php', + 'auth/passwords/reset.stub' => 'auth/passwords/reset.blade.php', + 'auth/emails/password.stub' => 'auth/emails/password.blade.php', + 'layouts/app.stub' => 'layouts/app.blade.php', + 'home.stub' => 'home.blade.php', + 'welcome.stub' => 'welcome.blade.php', + ]; + + /** + * Execute the console command. + * + * @return void + */ + public function fire() + { + $this->createDirectories(); + + $this->exportViews(); + + if (! $this->option('views')) { + $this->info('Installed HomeController.'); + + file_put_contents( + app_path('Http/Controllers/HomeController.php'), + $this->compileControllerStub() + ); + + $this->info('Updated Routes File.'); + + file_put_contents( + app_path('Http/routes.php'), + file_get_contents(__DIR__.'/stubs/make/routes.stub'), + FILE_APPEND + ); + } + + $this->comment('Authentication scaffolding generated successfully!'); + } + + /** + * Create the directories for the files. + * + * @return void + */ + protected function createDirectories() + { + if (! is_dir(base_path('resources/views/layouts'))) { + mkdir(base_path('resources/views/layouts'), 0755, true); + } + + if (! is_dir(base_path('resources/views/auth/passwords'))) { + mkdir(base_path('resources/views/auth/passwords'), 0755, true); + } + + if (! is_dir(base_path('resources/views/auth/emails'))) { + mkdir(base_path('resources/views/auth/emails'), 0755, true); + } + } + + /** + * Export the authentication views. + * + * @return void + */ + protected function exportViews() + { + foreach ($this->views as $key => $value) { + $path = base_path('resources/views/'.$value); + + $this->line('Created View: '.$path); + + copy(__DIR__.'/stubs/make/views/'.$key, $path); + } + } + + /** + * Compiles the HomeController stub. + * + * @return string + */ + protected function compileControllerStub() + { + return str_replace( + '{{namespace}}', + $this->getAppNamespace(), + file_get_contents(__DIR__.'/stubs/make/controllers/HomeController.stub') + ); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/controllers/HomeController.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/controllers/HomeController.stub new file mode 100644 index 0000000..669e2ea --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/controllers/HomeController.stub @@ -0,0 +1,29 @@ +middleware('auth'); + } + + /** + * Show the application dashboard. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view('home'); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/routes.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/routes.stub new file mode 100644 index 0000000..f459e94 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/routes.stub @@ -0,0 +1,4 @@ + +Route::auth(); + +Route::get('/home', 'HomeController@index'); diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/emails/password.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/emails/password.stub new file mode 100644 index 0000000..1b53830 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/emails/password.stub @@ -0,0 +1 @@ +Click here to reset your password: {{ $link }} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/login.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/login.stub new file mode 100644 index 0000000..a1ad8cf --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/login.stub @@ -0,0 +1,66 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Login
+
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + Forgot Your Password? +
+
+
+
+
+
+
+
+@endsection diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/email.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/email.stub new file mode 100644 index 0000000..33df8e3 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/email.stub @@ -0,0 +1,47 @@ +@extends('layouts.app') + + +@section('content') +
+
+
+
+
Reset Password
+
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif + +
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/reset.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/reset.stub new file mode 100644 index 0000000..64e8297 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/passwords/reset.stub @@ -0,0 +1,70 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Reset Password
+ +
+
+ {{ csrf_field() }} + + + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ +
+ + + @if ($errors->has('password_confirmation')) + + {{ $errors->first('password_confirmation') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/register.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/register.stub new file mode 100644 index 0000000..4705d6e --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/auth/register.stub @@ -0,0 +1,82 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Register
+
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('name')) + + {{ $errors->first('name') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password_confirmation')) + + {{ $errors->first('password_confirmation') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/home.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/home.stub new file mode 100644 index 0000000..7adf5c2 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/home.stub @@ -0,0 +1,17 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Dashboard
+ +
+ You are logged in! +
+
+
+
+
+@endsection diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub new file mode 100644 index 0000000..d909843 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/layouts/app.stub @@ -0,0 +1,82 @@ + + + + + + + + Laravel + + + + + + + + {{-- --}} + + + + + + + @yield('content') + + + + + {{-- --}} + + diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/welcome.stub b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/welcome.stub new file mode 100644 index 0000000..06e2217 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Console/stubs/make/views/welcome.stub @@ -0,0 +1,17 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Welcome
+ +
+ Your Application's Landing Page. +
+
+
+
+
+@endsection diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php b/application/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php new file mode 100644 index 0000000..715dee0 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/CreatesUserProviders.php @@ -0,0 +1,67 @@ +app['config']['auth.providers.'.$provider]; + + if (isset($this->customProviderCreators[$config['driver']])) { + return call_user_func( + $this->customProviderCreators[$config['driver']], $this->app, $config + ); + } + + switch ($config['driver']) { + case 'database': + return $this->createDatabaseProvider($config); + case 'eloquent': + return $this->createEloquentProvider($config); + default: + throw new InvalidArgumentException("Authentication user provider [{$config['driver']}] is not defined."); + } + } + + /** + * Create an instance of the database user provider. + * + * @param array $config + * @return \Illuminate\Auth\DatabaseUserProvider + */ + protected function createDatabaseProvider($config) + { + $connection = $this->app['db']->connection(); + + return new DatabaseUserProvider($connection, $this->app['hash'], $config['table']); + } + + /** + * Create an instance of the Eloquent user provider. + * + * @param array $config + * @return \Illuminate\Auth\EloquentUserProvider + */ + protected function createEloquentProvider($config) + { + return new EloquentUserProvider($this->app['hash'], $config['model']); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php b/application/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php old mode 100644 new mode 100755 index e23a63f..54cf035 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/DatabaseUserProvider.php @@ -86,8 +86,8 @@ public function retrieveByToken($identifier, $token) public function updateRememberToken(UserContract $user, $token) { $this->conn->table($this->table) - ->where('id', $user->getAuthIdentifier()) - ->update(['remember_token' => $token]); + ->where('id', $user->getAuthIdentifier()) + ->update(['remember_token' => $token]); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php b/application/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php old mode 100644 new mode 100755 index e2b6dc7..780c997 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php @@ -59,7 +59,7 @@ public function retrieveByToken($identifier, $token) $model = $this->createModel(); return $model->newQuery() - ->where($model->getKeyName(), $identifier) + ->where($model->getAuthIdentifierName(), $identifier) ->where($model->getRememberTokenName(), $token) ->first(); } @@ -86,6 +86,10 @@ public function updateRememberToken(UserContract $user, $token) */ public function retrieveByCredentials(array $credentials) { + if (empty($credentials)) { + return; + } + // First we will add each credential element to the query as a where clause. // Then we can execute the query and, if we found a user, return it in a // Eloquent User "model" that will be utilized by the Guard instances. diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Attempting.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Attempting.php new file mode 100644 index 0000000..805db22 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Attempting.php @@ -0,0 +1,41 @@ +login = $login; + $this->remember = $remember; + $this->credentials = $credentials; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Failed.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Failed.php new file mode 100644 index 0000000..5807e8e --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Failed.php @@ -0,0 +1,32 @@ +user = $user; + $this->credentials = $credentials; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Lockout.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Lockout.php new file mode 100644 index 0000000..347943f --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Lockout.php @@ -0,0 +1,26 @@ +request = $request; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Login.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Login.php new file mode 100644 index 0000000..8816745 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Login.php @@ -0,0 +1,37 @@ +user = $user; + $this->remember = $remember; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php new file mode 100644 index 0000000..ea788e7 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Events/Logout.php @@ -0,0 +1,28 @@ +user = $user; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/GeneratorServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Auth/GeneratorServiceProvider.php deleted file mode 100644 index 1b9ce10..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/GeneratorServiceProvider.php +++ /dev/null @@ -1,65 +0,0 @@ -commands as $command) { - $this->{"register{$command}Command"}(); - } - - $this->commands( - 'command.auth.resets.clear' - ); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerClearResetsCommand() - { - $this->app->singleton('command.auth.resets.clear', function () { - return new ClearResetsCommand; - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'command.auth.resets.clear', - ]; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php b/application/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php old mode 100644 new mode 100755 index d349d49..b6880c0 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/GenericUser.php @@ -24,6 +24,16 @@ public function __construct(array $attributes) $this->attributes = $attributes; } + /** + * Get the name of the unique identifier for the user. + * + * @return string + */ + public function getAuthIdentifierName() + { + return 'id'; + } + /** * Get the unique identifier for the user. * @@ -31,7 +41,9 @@ public function __construct(array $attributes) */ public function getAuthIdentifier() { - return $this->attributes['id']; + $name = $this->getAuthIdentifierName(); + + return $this->attributes[$name]; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php b/application/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php new file mode 100644 index 0000000..95fee3a --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/GuardHelpers.php @@ -0,0 +1,86 @@ +user())) { + return $user; + } + + throw new AuthenticationException($this); + } + + /** + * Determine if the current user is authenticated. + * + * @return bool + */ + public function check() + { + return ! is_null($this->user()); + } + + /** + * Determine if the current user is a guest. + * + * @return bool + */ + public function guest() + { + return ! $this->check(); + } + + /** + * Get the ID for the currently authenticated user. + * + * @return int|null + */ + public function id() + { + if ($this->user()) { + return $this->user()->getAuthIdentifier(); + } + } + + /** + * Set the current user. + * + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @return $this + */ + public function setUser(AuthenticatableContract $user) + { + $this->user = $user; + + return $this; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php index a2418b3..71f8be8 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php @@ -3,24 +3,24 @@ namespace Illuminate\Auth\Middleware; use Closure; -use Illuminate\Contracts\Auth\Guard; +use Illuminate\Contracts\Auth\Factory as AuthFactory; class AuthenticateWithBasicAuth { /** - * The guard instance. + * The guard factory instance. * - * @var \Illuminate\Contracts\Auth\Guard + * @var \Illuminate\Contracts\Auth\Factory */ protected $auth; /** * Create a new middleware instance. * - * @param \Illuminate\Contracts\Auth\Guard $auth + * @param \Illuminate\Contracts\Auth\Factory $auth * @return void */ - public function __construct(Guard $auth) + public function __construct(AuthFactory $auth) { $this->auth = $auth; } @@ -30,10 +30,11 @@ public function __construct(Guard $auth) * * @param \Illuminate\Http\Request $request * @param \Closure $next + * @param string|null $guard * @return mixed */ - public function handle($request, Closure $next) + public function handle($request, Closure $next, $guard = null) { - return $this->auth->basic() ?: $next($request); + return $this->auth->guard($guard)->basic() ?: $next($request); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php old mode 100644 new mode 100755 index db93cf9..2bffaa9 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php @@ -123,19 +123,9 @@ public function exists(CanResetPasswordContract $user, $token) */ protected function tokenExpired($token) { - $expirationTime = strtotime($token['created_at']) + $this->expires; + $expiresAt = Carbon::parse($token['created_at'])->addSeconds($this->expires); - return $expirationTime < $this->getCurrentTime(); - } - - /** - * Get the current UNIX timestamp. - * - * @return int - */ - protected function getCurrentTime() - { - return time(); + return $expiresAt->isPast(); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php old mode 100644 new mode 100755 index 2fecd5b..4621b42 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBroker.php @@ -82,7 +82,7 @@ public function sendResetLink(array $credentials, Closure $callback = null) $user = $this->getUser($credentials); if (is_null($user)) { - return PasswordBrokerContract::INVALID_USER; + return static::INVALID_USER; } // Once we have the reset token, we are ready to send the message out to this @@ -92,7 +92,7 @@ public function sendResetLink(array $credentials, Closure $callback = null) $this->emailResetLink($user, $token, $callback); - return PasswordBrokerContract::RESET_LINK_SENT; + return static::RESET_LINK_SENT; } /** @@ -146,7 +146,7 @@ public function reset(array $credentials, Closure $callback) $this->tokens->delete($credentials['token']); - return PasswordBrokerContract::PASSWORD_RESET; + return static::PASSWORD_RESET; } /** @@ -158,15 +158,15 @@ public function reset(array $credentials, Closure $callback) protected function validateReset(array $credentials) { if (is_null($user = $this->getUser($credentials))) { - return PasswordBrokerContract::INVALID_USER; + return static::INVALID_USER; } if (! $this->validateNewPassword($credentials)) { - return PasswordBrokerContract::INVALID_PASSWORD; + return static::INVALID_PASSWORD; } if (! $this->tokens->exists($user, $credentials['token'])) { - return PasswordBrokerContract::INVALID_TOKEN; + return static::INVALID_TOKEN; } return $user; @@ -241,12 +241,46 @@ public function getUser(array $credentials) return $user; } + /** + * Create a new password reset token for the given user. + * + * @param CanResetPasswordContract $user + * @return string + */ + public function createToken(CanResetPasswordContract $user) + { + return $this->tokens->create($user); + } + + /** + * Delete the given password reset token. + * + * @param string $token + * @return void + */ + public function deleteToken($token) + { + $this->tokens->delete($token); + } + + /** + * Validate the given password reset token. + * + * @param CanResetPasswordContract $user + * @param string $token + * @return bool + */ + public function tokenExists(CanResetPasswordContract $user, $token) + { + return $this->tokens->exists($user, $token); + } + /** * Get the password reset token repository implementation. * * @return \Illuminate\Auth\Passwords\TokenRepositoryInterface */ - protected function getRepository() + public function getRepository() { return $this->tokens; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php new file mode 100644 index 0000000..8edcf92 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordBrokerManager.php @@ -0,0 +1,145 @@ +app = $app; + } + + /** + * Attempt to get the broker from the local cache. + * + * @param string $name + * @return \Illuminate\Contracts\Auth\PasswordBroker + */ + public function broker($name = null) + { + $name = $name ?: $this->getDefaultDriver(); + + return isset($this->brokers[$name]) + ? $this->brokers[$name] + : $this->brokers[$name] = $this->resolve($name); + } + + /** + * Resolve the given broker. + * + * @param string $name + * @return \Illuminate\Contracts\Auth\PasswordBroker + * + * @throws \InvalidArgumentException + */ + protected function resolve($name) + { + $config = $this->getConfig($name); + + if (is_null($config)) { + throw new InvalidArgumentException("Password resetter [{$name}] is not defined."); + } + + // The password broker uses a token repository to validate tokens and send user + // password e-mails, as well as validating that password reset process as an + // aggregate service of sorts providing a convenient interface for resets. + return new PasswordBroker( + $this->createTokenRepository($config), + $this->app['auth']->createUserProvider($config['provider']), + $this->app['mailer'], + $config['email'] + ); + } + + /** + * Create a token repository instance based on the given configuration. + * + * @param array $config + * @return \Illuminate\Auth\Passwords\TokenRepositoryInterface + */ + protected function createTokenRepository(array $config) + { + $key = $this->app['config']['app.key']; + + if (Str::startsWith($key, 'base64:')) { + $key = base64_decode(substr($key, 7)); + } + + $connection = isset($config['connection']) ? $config['connection'] : null; + + return new DatabaseTokenRepository( + $this->app['db']->connection($connection), + $config['table'], + $key, + $config['expire'] + ); + } + + /** + * Get the password broker configuration. + * + * @param string $name + * @return array + */ + protected function getConfig($name) + { + return $this->app['config']["auth.passwords.{$name}"]; + } + + /** + * Get the default password broker name. + * + * @return string + */ + public function getDefaultDriver() + { + return $this->app['config']['auth.defaults.passwords']; + } + + /** + * Set the default password broker name. + * + * @param string $name + * @return void + */ + public function setDefaultDriver($name) + { + $this->app['config']['auth.defaults.passwords'] = $name; + } + + /** + * Dynamically call the default driver instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return call_user_func_array([$this->broker(), $method], $parameters); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php old mode 100644 new mode 100755 index 2da8f7d..165ecaf --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/PasswordResetServiceProvider.php @@ -3,7 +3,6 @@ namespace Illuminate\Auth\Passwords; use Illuminate\Support\ServiceProvider; -use Illuminate\Auth\Passwords\DatabaseTokenRepository as DbRepository; class PasswordResetServiceProvider extends ServiceProvider { @@ -22,8 +21,6 @@ class PasswordResetServiceProvider extends ServiceProvider public function register() { $this->registerPasswordBroker(); - - $this->registerTokenRepository(); } /** @@ -34,44 +31,11 @@ public function register() protected function registerPasswordBroker() { $this->app->singleton('auth.password', function ($app) { - // The password token repository is responsible for storing the email addresses - // and password reset tokens. It will be used to verify the tokens are valid - // for the given e-mail addresses. We will resolve an implementation here. - $tokens = $app['auth.password.tokens']; - - $users = $app['auth']->driver()->getProvider(); - - $view = $app['config']['auth.password.email']; - - // The password broker uses a token repository to validate tokens and send user - // password e-mails, as well as validating that password reset process as an - // aggregate service of sorts providing a convenient interface for resets. - return new PasswordBroker( - $tokens, $users, $app['mailer'], $view - ); + return new PasswordBrokerManager($app); }); - } - - /** - * Register the token repository implementation. - * - * @return void - */ - protected function registerTokenRepository() - { - $this->app->singleton('auth.password.tokens', function ($app) { - $connection = $app['db']->connection(); - - // The database token repository is an implementation of the token repository - // interface, and is responsible for the actual storing of auth tokens and - // their e-mail addresses. We will inject this table and hash key to it. - $table = $app['config']['auth.password.table']; - - $key = $app['config']['app.key']; - - $expire = $app['config']->get('auth.password.expire', 60); - return new DbRepository($connection, $table, $key, $expire); + $this->app->bind('auth.password.broker', function ($app) { + return $app->make('auth.password')->broker(); }); } @@ -82,6 +46,6 @@ protected function registerTokenRepository() */ public function provides() { - return ['auth.password', 'auth.password.tokens']; + return ['auth.password', 'auth.password.broker']; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php b/application/vendor/laravel/framework/src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php b/application/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php new file mode 100644 index 0000000..e6b9a7e --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/RequestGuard.php @@ -0,0 +1,81 @@ +request = $request; + $this->callback = $callback; + } + + /** + * Get the currently authenticated user. + * + * @return \Illuminate\Contracts\Auth\Authenticatable|null + */ + public function user() + { + // If we've already retrieved the user for the current request we can just + // return it back immediately. We do not want to fetch the user data on + // every call to this method because that would be tremendously slow. + if (! is_null($this->user)) { + return $this->user; + } + + return $this->user = call_user_func($this->callback, $this->request); + } + + /** + * Validate a user's credentials. + * + * @param array $credentials + * @return bool + */ + public function validate(array $credentials = []) + { + return ! is_null((new static( + $this->callback, $credentials['request'] + ))->user()); + } + + /** + * Set the current request instance. + * + * @param \Illuminate\Http\Request $request + * @return $this + */ + public function setRequest(Request $request) + { + $this->request = $request; + + return $this; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/Guard.php b/application/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php similarity index 84% rename from application/vendor/laravel/framework/src/Illuminate/Auth/Guard.php rename to application/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php index 482c3ea..2e85639 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/Guard.php +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php @@ -4,23 +4,28 @@ use RuntimeException; use Illuminate\Support\Str; -use Illuminate\Contracts\Auth\UserProvider; +use Illuminate\Http\Response; use Illuminate\Contracts\Events\Dispatcher; +use Illuminate\Contracts\Auth\UserProvider; +use Illuminate\Contracts\Auth\StatefulGuard; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Illuminate\Contracts\Auth\Guard as GuardContract; +use Illuminate\Contracts\Auth\SupportsBasicAuth; use Illuminate\Contracts\Cookie\QueueingFactory as CookieJar; -use Illuminate\Contracts\Auth\Authenticatable as UserContract; use Symfony\Component\HttpFoundation\Session\SessionInterface; +use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; -class Guard implements GuardContract +class SessionGuard implements StatefulGuard, SupportsBasicAuth { + use GuardHelpers; + /** - * The currently authenticated user. + * The name of the Guard. Typically "session". * - * @var \Illuminate\Contracts\Auth\Authenticatable + * Corresponds to driver name in authentication configuration. + * + * @var string */ - protected $user; + protected $name; /** * The user we last attempted to retrieve. @@ -36,13 +41,6 @@ class Guard implements GuardContract */ protected $viaRemember = false; - /** - * The user provider implementation. - * - * @var \Illuminate\Contracts\Auth\UserProvider - */ - protected $provider; - /** * The session used by the guard. * @@ -88,40 +86,23 @@ class Guard implements GuardContract /** * Create a new authentication guard. * + * @param string $name * @param \Illuminate\Contracts\Auth\UserProvider $provider * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ - public function __construct(UserProvider $provider, + public function __construct($name, + UserProvider $provider, SessionInterface $session, Request $request = null) { + $this->name = $name; $this->session = $session; $this->request = $request; $this->provider = $provider; } - /** - * Determine if the current user is authenticated. - * - * @return bool - */ - public function check() - { - return ! is_null($this->user()); - } - - /** - * Determine if the current user is a guest. - * - * @return bool - */ - public function guest() - { - return ! $this->check(); - } - /** * Get the currently authenticated user. * @@ -233,7 +214,7 @@ protected function getRecallerId() /** * Determine if the recaller cookie is in a valid format. * - * @param string $recaller + * @param mixed $recaller * @return bool */ protected function validRecaller($recaller) @@ -279,9 +260,10 @@ public function validate(array $credentials = []) * Attempt to authenticate using HTTP Basic Auth. * * @param string $field + * @param array $extraConditions * @return \Symfony\Component\HttpFoundation\Response|null */ - public function basic($field = 'email') + public function basic($field = 'email', $extraConditions = []) { if ($this->check()) { return; @@ -290,7 +272,7 @@ public function basic($field = 'email') // If a username is set on the HTTP basic request, we will return out without // interrupting the request lifecycle. Otherwise, we'll need to generate a // request indicating that the given credentials were invalid for login. - if ($this->attemptBasic($this->getRequest(), $field)) { + if ($this->attemptBasic($this->getRequest(), $field, $extraConditions)) { return; } @@ -301,11 +283,14 @@ public function basic($field = 'email') * Perform a stateless HTTP Basic login attempt. * * @param string $field + * @param array $extraConditions * @return \Symfony\Component\HttpFoundation\Response|null */ - public function onceBasic($field = 'email') + public function onceBasic($field = 'email', $extraConditions = []) { - if (! $this->once($this->getBasicCredentials($this->getRequest(), $field))) { + $credentials = $this->getBasicCredentials($this->getRequest(), $field); + + if (! $this->once(array_merge($credentials, $extraConditions))) { return $this->getBasicResponse(); } } @@ -315,15 +300,18 @@ public function onceBasic($field = 'email') * * @param \Symfony\Component\HttpFoundation\Request $request * @param string $field + * @param array $extraConditions * @return bool */ - protected function attemptBasic(Request $request, $field) + protected function attemptBasic(Request $request, $field, $extraConditions = []) { if (! $request->getUser()) { return false; } - return $this->attempt($this->getBasicCredentials($request, $field)); + $credentials = $this->getBasicCredentials($request, $field); + + return $this->attempt(array_merge($credentials, $extraConditions)); } /** @@ -375,6 +363,13 @@ public function attempt(array $credentials = [], $remember = false, $login = tru return true; } + // If the authentication attempt fails we will fire an event so that the user + // may be notified of any suspicious attempts to access their account from + // an unrecognized user. A developer may listen to this event as needed. + if ($login) { + $this->fireFailedEvent($user, $credentials); + } + return false; } @@ -400,10 +395,24 @@ protected function hasValidCredentials($user, $credentials) */ protected function fireAttemptEvent(array $credentials, $remember, $login) { - if ($this->events) { - $payload = [$credentials, $remember, $login]; + if (isset($this->events)) { + $this->events->fire(new Events\Attempting( + $credentials, $remember, $login + )); + } + } - $this->events->fire('auth.attempt', $payload); + /** + * Fire the failed authentication attempt event with the given arguments. + * + * @param \Illuminate\Contracts\Auth\Authenticatable|null $user + * @param array $credentials + * @return void + */ + protected function fireFailedEvent($user, array $credentials) + { + if (isset($this->events)) { + $this->events->fire(new Events\Failed($user, $credentials)); } } @@ -415,8 +424,8 @@ protected function fireAttemptEvent(array $credentials, $remember, $login) */ public function attempting($callback) { - if ($this->events) { - $this->events->listen('auth.attempt', $callback); + if (isset($this->events)) { + $this->events->listen(Events\Attempting::class, $callback); } } @@ -427,7 +436,7 @@ public function attempting($callback) * @param bool $remember * @return void */ - public function login(UserContract $user, $remember = false) + public function login(AuthenticatableContract $user, $remember = false) { $this->updateSession($user->getAuthIdentifier()); @@ -458,7 +467,7 @@ public function login(UserContract $user, $remember = false) protected function fireLoginEvent($user, $remember = false) { if (isset($this->events)) { - $this->events->fire('auth.login', [$user, $remember]); + $this->events->fire(new Events\Login($user, $remember)); } } @@ -484,11 +493,15 @@ protected function updateSession($id) */ public function loginUsingId($id, $remember = false) { - $this->session->set($this->getName(), $id); + $user = $this->provider->retrieveById($id); - $this->login($user = $this->provider->retrieveById($id), $remember); + if (! is_null($user)) { + $this->login($user, $remember); + + return $user; + } - return $user; + return false; } /** @@ -499,7 +512,9 @@ public function loginUsingId($id, $remember = false) */ public function onceUsingId($id) { - if (! is_null($user = $this->provider->retrieveById($id))) { + $user = $this->provider->retrieveById($id); + + if (! is_null($user)) { $this->setUser($user); return true; @@ -514,7 +529,7 @@ public function onceUsingId($id) * @param \Illuminate\Contracts\Auth\Authenticatable $user * @return void */ - protected function queueRecallerCookie(UserContract $user) + protected function queueRecallerCookie(AuthenticatableContract $user) { $value = $user->getAuthIdentifier().'|'.$user->getRememberToken(); @@ -551,7 +566,7 @@ public function logout() } if (isset($this->events)) { - $this->events->fire('auth.logout', [$user]); + $this->events->fire(new Events\Logout($user)); } // Once we have fired the logout event we will clear the users out of memory @@ -584,7 +599,7 @@ protected function clearUserDataFromStorage() * @param \Illuminate\Contracts\Auth\Authenticatable $user * @return void */ - protected function refreshRememberToken(UserContract $user) + protected function refreshRememberToken(AuthenticatableContract $user) { $user->setRememberToken($token = Str::random(60)); @@ -597,7 +612,7 @@ protected function refreshRememberToken(UserContract $user) * @param \Illuminate\Contracts\Auth\Authenticatable $user * @return void */ - protected function createRememberTokenIfDoesntExist(UserContract $user) + protected function createRememberTokenIfDoesntExist(AuthenticatableContract $user) { if (empty($user->getRememberToken())) { $this->refreshRememberToken($user); @@ -697,13 +712,15 @@ public function getUser() * Set the current user. * * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void + * @return $this */ - public function setUser(UserContract $user) + public function setUser(AuthenticatableContract $user) { $this->user = $user; $this->loggedOut = false; + + return $this; } /** @@ -746,7 +763,7 @@ public function getLastAttempted() */ public function getName() { - return 'login_'.md5(get_class($this)); + return 'login_'.$this->name.'_'.sha1(static::class); } /** @@ -756,7 +773,7 @@ public function getName() */ public function getRecallerName() { - return 'remember_'.md5(get_class($this)); + return 'remember_'.$this->name.'_'.sha1(static::class); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/TokenGuard.php b/application/vendor/laravel/framework/src/Illuminate/Auth/TokenGuard.php new file mode 100644 index 0000000..2a33ab0 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/TokenGuard.php @@ -0,0 +1,129 @@ +request = $request; + $this->provider = $provider; + $this->inputKey = 'api_token'; + $this->storageKey = 'api_token'; + } + + /** + * Get the currently authenticated user. + * + * @return \Illuminate\Contracts\Auth\Authenticatable|null + */ + public function user() + { + // If we've already retrieved the user for the current request we can just + // return it back immediately. We do not want to fetch the user data on + // every call to this method because that would be tremendously slow. + if (! is_null($this->user)) { + return $this->user; + } + + $user = null; + + $token = $this->getTokenForRequest(); + + if (! empty($token)) { + $user = $this->provider->retrieveByCredentials( + [$this->storageKey => $token] + ); + } + + return $this->user = $user; + } + + /** + * Get the token for the current request. + * + * @return string + */ + protected function getTokenForRequest() + { + $token = $this->request->input($this->inputKey); + + if (empty($token)) { + $token = $this->request->bearerToken(); + } + + if (empty($token)) { + $token = $this->request->getPassword(); + } + + return $token; + } + + /** + * Validate a user's credentials. + * + * @param array $credentials + * @return bool + */ + public function validate(array $credentials = []) + { + if (empty($credentials[$this->inputKey])) { + return false; + } + + $credentials = [$this->storageKey => $credentials[$this->inputKey]]; + + if ($this->provider->retrieveByCredentials($credentials)) { + return true; + } + + return false; + } + + /** + * Set the current request instance. + * + * @param \Illuminate\Http\Request $request + * @return $this + */ + public function setRequest(Request $request) + { + $this->request = $request; + + return $this; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Auth/composer.json b/application/vendor/laravel/framework/src/Illuminate/Auth/composer.json old mode 100644 new mode 100755 index 8bb3c66..669c217 --- a/application/vendor/laravel/framework/src/Illuminate/Auth/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Auth/composer.json @@ -10,16 +10,15 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/http": "5.1.*", - "illuminate/session": "5.1.*", - "illuminate/support": "5.1.*", - "nesbot/carbon": "~1.19" + "illuminate/contracts": "5.2.*", + "illuminate/http": "5.2.*", + "illuminate/support": "5.2.*", + "nesbot/carbon": "~1.20" }, "autoload": { "psr-4": { @@ -28,11 +27,13 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { - "illuminate/console": "Required to use the auth:clear-resets command (5.1.*)." + "illuminate/console": "Required to use the auth:clear-resets command (5.2.*).", + "illuminate/queue": "Required to fire login / logout events (5.2.*).", + "illuminate/session": "Required to use the session based guard (5.2.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php b/application/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php index 97a0fe5..05a83d4 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php @@ -104,7 +104,7 @@ protected function resolve($name) if (method_exists($this, $driverMethod)) { return $this->{$driverMethod}($config); } else { - throw new InvalidArgumentException("Driver [{$config['driver']}] not supported."); + throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json b/application/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json index c3e89d1..53feb54 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Broadcasting/composer.json @@ -10,13 +10,13 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { diff --git a/application/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php index 55eeb2a..affdb4d 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php @@ -21,8 +21,8 @@ class BusServiceProvider extends ServiceProvider public function register() { $this->app->singleton('Illuminate\Bus\Dispatcher', function ($app) { - return new Dispatcher($app, function () use ($app) { - return $app['Illuminate\Contracts\Queue\Queue']; + return new Dispatcher($app, function ($connection = null) use ($app) { + return $app['Illuminate\Contracts\Queue\Factory']->connection($connection); }); }); diff --git a/application/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php b/application/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php index cecf9f1..70e9b67 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php +++ b/application/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php @@ -3,22 +3,14 @@ namespace Illuminate\Bus; use Closure; -use ArrayAccess; -use ReflectionClass; use RuntimeException; -use ReflectionParameter; -use InvalidArgumentException; use Illuminate\Pipeline\Pipeline; -use Illuminate\Support\Collection; use Illuminate\Contracts\Queue\Queue; -use Illuminate\Contracts\Bus\SelfHandling; use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Contracts\Bus\HandlerResolver; use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\Bus\QueueingDispatcher; -use Illuminate\Contracts\Bus\Dispatcher as DispatcherContract; -class Dispatcher implements DispatcherContract, QueueingDispatcher, HandlerResolver +class Dispatcher implements QueueingDispatcher { /** * The container implementation. @@ -48,20 +40,6 @@ class Dispatcher implements DispatcherContract, QueueingDispatcher, HandlerResol */ protected $queueResolver; - /** - * All of the command-to-handler mappings. - * - * @var array - */ - protected $mappings = []; - - /** - * The fallback mapping Closure. - * - * @var \Closure - */ - protected $mapper; - /** * Create a new command dispatcher instance. * @@ -76,105 +54,18 @@ public function __construct(Container $container, Closure $queueResolver = null) $this->pipeline = new Pipeline($container); } - /** - * Marshal a command and dispatch it to its appropriate handler. - * - * @param mixed $command - * @param array $array - * @return mixed - */ - public function dispatchFromArray($command, array $array) - { - return $this->dispatch($this->marshalFromArray($command, $array)); - } - - /** - * Marshal a command and dispatch it to its appropriate handler. - * - * @param mixed $command - * @param \ArrayAccess $source - * @param array $extras - * @return mixed - */ - public function dispatchFrom($command, ArrayAccess $source, array $extras = []) - { - return $this->dispatch($this->marshal($command, $source, $extras)); - } - - /** - * Marshal a command from the given array. - * - * @param string $command - * @param array $array - * @return mixed - */ - protected function marshalFromArray($command, array $array) - { - return $this->marshal($command, new Collection, $array); - } - - /** - * Marshal a command from the given array accessible object. - * - * @param string $command - * @param \ArrayAccess $source - * @param array $extras - * @return mixed - */ - protected function marshal($command, ArrayAccess $source, array $extras = []) - { - $injected = []; - - $reflection = new ReflectionClass($command); - - if ($constructor = $reflection->getConstructor()) { - $injected = array_map(function ($parameter) use ($command, $source, $extras) { - return $this->getParameterValueForCommand($command, $source, $parameter, $extras); - }, $constructor->getParameters()); - } - - return $reflection->newInstanceArgs($injected); - } - - /** - * Get a parameter value for a marshalled command. - * - * @param string $command - * @param \ArrayAccess $source - * @param \ReflectionParameter $parameter - * @param array $extras - * @return mixed - */ - protected function getParameterValueForCommand($command, ArrayAccess $source, ReflectionParameter $parameter, array $extras = []) - { - if (array_key_exists($parameter->name, $extras)) { - return $extras[$parameter->name]; - } - - if (isset($source[$parameter->name])) { - return $source[$parameter->name]; - } - - if ($parameter->isDefaultValueAvailable()) { - return $parameter->getDefaultValue(); - } - - MarshalException::whileMapping($command, $parameter); - } - /** * Dispatch a command to its appropriate handler. * * @param mixed $command - * @param \Closure|null $afterResolving * @return mixed */ - public function dispatch($command, Closure $afterResolving = null) + public function dispatch($command) { if ($this->queueResolver && $this->commandShouldBeQueued($command)) { return $this->dispatchToQueue($command); } else { - return $this->dispatchNow($command, $afterResolving); + return $this->dispatchNow($command); } } @@ -182,25 +73,12 @@ public function dispatch($command, Closure $afterResolving = null) * Dispatch a command to its appropriate handler in the current process. * * @param mixed $command - * @param \Closure|null $afterResolving * @return mixed */ - public function dispatchNow($command, Closure $afterResolving = null) + public function dispatchNow($command) { - return $this->pipeline->send($command)->through($this->pipes)->then(function ($command) use ($afterResolving) { - if ($command instanceof SelfHandling) { - return $this->container->call([$command, 'handle']); - } - - $handler = $this->resolveHandler($command); - - if ($afterResolving) { - call_user_func($afterResolving, $handler); - } - - return call_user_func( - [$handler, $this->getHandlerMethod($command)], $command - ); + return $this->pipeline->send($command)->through($this->pipes)->then(function ($command) { + return $this->container->call([$command, 'handle']); }); } @@ -212,13 +90,7 @@ public function dispatchNow($command, Closure $afterResolving = null) */ protected function commandShouldBeQueued($command) { - if ($command instanceof ShouldQueue) { - return true; - } - - return (new ReflectionClass($this->getHandlerClass($command)))->implementsInterface( - 'Illuminate\Contracts\Queue\ShouldQueue' - ); + return $command instanceof ShouldQueue; } /** @@ -231,7 +103,9 @@ protected function commandShouldBeQueued($command) */ public function dispatchToQueue($command) { - $queue = call_user_func($this->queueResolver); + $connection = isset($command->connection) ? $command->connection : null; + + $queue = call_user_func($this->queueResolver, $connection); if (! $queue instanceof Queue) { throw new RuntimeException('Queue resolver did not return a Queue implementation.'); @@ -268,132 +142,6 @@ protected function pushCommandToQueue($queue, $command) return $queue->push($command); } - /** - * Get the handler instance for the given command. - * - * @param mixed $command - * @return mixed - */ - public function resolveHandler($command) - { - if ($command instanceof SelfHandling) { - return $command; - } - - return $this->container->make($this->getHandlerClass($command)); - } - - /** - * Get the handler class for the given command. - * - * @param mixed $command - * @return string - */ - public function getHandlerClass($command) - { - if ($command instanceof SelfHandling) { - return get_class($command); - } - - return $this->inflectSegment($command, 0); - } - - /** - * Get the handler method for the given command. - * - * @param mixed $command - * @return string - */ - public function getHandlerMethod($command) - { - if ($command instanceof SelfHandling) { - return 'handle'; - } - - return $this->inflectSegment($command, 1); - } - - /** - * Get the given handler segment for the given command. - * - * @param mixed $command - * @param int $segment - * @return string - */ - protected function inflectSegment($command, $segment) - { - $className = get_class($command); - - if (isset($this->mappings[$className])) { - return $this->getMappingSegment($className, $segment); - } elseif ($this->mapper) { - return $this->getMapperSegment($command, $segment); - } - - throw new InvalidArgumentException("No handler registered for command [{$className}]"); - } - - /** - * Get the given segment from a given class handler. - * - * @param string $className - * @param int $segment - * @return string - */ - protected function getMappingSegment($className, $segment) - { - return explode('@', $this->mappings[$className])[$segment]; - } - - /** - * Get the given segment from a given class handler using the custom mapper. - * - * @param mixed $command - * @param int $segment - * @return string - */ - protected function getMapperSegment($command, $segment) - { - return explode('@', call_user_func($this->mapper, $command))[$segment]; - } - - /** - * Register command-to-handler mappings. - * - * @param array $commands - * @return void - */ - public function maps(array $commands) - { - $this->mappings = array_merge($this->mappings, $commands); - } - - /** - * Register a fallback mapper callback. - * - * @param \Closure $mapper - * @return void - */ - public function mapUsing(Closure $mapper) - { - $this->mapper = $mapper; - } - - /** - * Map the command to a handler within a given root namespace. - * - * @param mixed $command - * @param string $commandNamespace - * @param string $handlerNamespace - * @return string - */ - public static function simpleMapping($command, $commandNamespace, $handlerNamespace) - { - $command = str_replace($commandNamespace, '', get_class($command)); - - return $handlerNamespace.'\\'.trim($command, '\\').'Handler@handle'; - } - /** * Set the pipes through which commands should be piped before dispatching. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Bus/MarshalException.php b/application/vendor/laravel/framework/src/Illuminate/Bus/MarshalException.php deleted file mode 100644 index 49c7674..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Bus/MarshalException.php +++ /dev/null @@ -1,23 +0,0 @@ -name}] to command [{$command}]"); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Bus/Queueable.php b/application/vendor/laravel/framework/src/Illuminate/Bus/Queueable.php index 42d1ca5..a7d306a 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Bus/Queueable.php +++ b/application/vendor/laravel/framework/src/Illuminate/Bus/Queueable.php @@ -4,24 +4,44 @@ trait Queueable { + /** + * The name of the connection the job should be sent to. + * + * @var string|null + */ + public $connection; + /** * The name of the queue the job should be sent to. * - * @var string + * @var string|null */ public $queue; /** - * The seconds before the job should be made available. + * The number of seconds before the job should be made available. * - * @var int + * @var \DateTime|int|null */ public $delay; + /** + * Set the desired connection for the job. + * + * @param string|null $connection + * @return $this + */ + public function onConnection($connection) + { + $this->connection = $connection; + + return $this; + } + /** * Set the desired queue for the job. * - * @param string $queue + * @param string|null $queue * @return $this */ public function onQueue($queue) @@ -34,7 +54,7 @@ public function onQueue($queue) /** * Set the desired delay for the job. * - * @param int $delay + * @param int|null $delay * @return $this */ public function delay($delay) diff --git a/application/vendor/laravel/framework/src/Illuminate/Bus/composer.json b/application/vendor/laravel/framework/src/Illuminate/Bus/composer.json index 16982e6..12dd516 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Bus/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Bus/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/pipeline": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/contracts": "5.2.*", + "illuminate/pipeline": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php old mode 100644 new mode 100755 index 9125dec..5fc88d5 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/ApcStore.php @@ -6,6 +6,8 @@ class ApcStore extends TaggableStore implements Store { + use RetrievesMultipleKeys; + /** * The APC wrapper instance. * @@ -36,7 +38,7 @@ public function __construct(ApcWrapper $apc, $prefix = '') /** * Retrieve an item from the cache by key. * - * @param string $key + * @param string|array $key * @return mixed */ public function get($key) diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php b/application/vendor/laravel/framework/src/Illuminate/Cache/ApcWrapper.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php old mode 100644 new mode 100755 index 3dd8c04..cc99318 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/ArrayStore.php @@ -6,6 +6,8 @@ class ArrayStore extends TaggableStore implements Store { + use RetrievesMultipleKeys; + /** * The array of stored values. * @@ -16,7 +18,7 @@ class ArrayStore extends TaggableStore implements Store /** * Retrieve an item from the cache by key. * - * @param string $key + * @param string|array $key * @return mixed */ public function get($key) @@ -54,7 +56,7 @@ public function increment($key, $value = 1) } /** - * Increment the value of an item in the cache. + * Decrement the value of an item in the cache. * * @param string $key * @param mixed $value diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php b/application/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php old mode 100644 new mode 100755 index 1eb7935..1b7cdc9 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php @@ -101,7 +101,7 @@ protected function resolve($name) if (method_exists($this, $driverMethod)) { return $this->{$driverMethod}($config); } else { - throw new InvalidArgumentException("Driver [{$config['driver']}] not supported."); + throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); } } } @@ -176,28 +176,6 @@ protected function createNullDriver() return $this->repository(new NullStore); } - /** - * Create an instance of the WinCache cache driver. - * - * @param array $config - * @return \Illuminate\Cache\WinCacheStore - */ - protected function createWincacheDriver(array $config) - { - return $this->repository(new WinCacheStore($this->getPrefix($config))); - } - - /** - * Create an instance of the XCache cache driver. - * - * @param array $config - * @return \Illuminate\Cache\WinCacheStore - */ - protected function createXcacheDriver(array $config) - { - return $this->repository(new XCacheStore($this->getPrefix($config))); - } - /** * Create an instance of the Redis cache driver. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php old mode 100644 new mode 100755 index fe4801e..8b0b468 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/CacheServiceProvider.php @@ -4,7 +4,6 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Cache\Console\ClearCommand; -use Illuminate\Cache\Console\CacheTableCommand; class CacheServiceProvider extends ServiceProvider { @@ -48,11 +47,7 @@ public function registerCommands() return new ClearCommand($app['cache']); }); - $this->app->singleton('command.cache.table', function ($app) { - return new CacheTableCommand($app['files'], $app['composer']); - }); - - $this->commands('command.cache.clear', 'command.cache.table'); + $this->commands('command.cache.clear'); } /** @@ -63,7 +58,7 @@ public function registerCommands() public function provides() { return [ - 'cache', 'cache.store', 'memcached.connector', 'command.cache.clear', 'command.cache.table', + 'cache', 'cache.store', 'memcached.connector', 'command.cache.clear', ]; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php index 2e436d6..7c3f4b6 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Console/CacheTableCommand.php @@ -3,7 +3,7 @@ namespace Illuminate\Cache\Console; use Illuminate\Console\Command; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; class CacheTableCommand extends Command @@ -30,7 +30,7 @@ class CacheTableCommand extends Command protected $files; /** - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -38,7 +38,7 @@ class CacheTableCommand extends Command * Create a new cache table command instance. * * @param \Illuminate\Filesystem\Filesystem $files - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(Filesystem $files, Composer $composer) diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php old mode 100644 new mode 100755 index 02ea032..899269a --- a/application/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Console/ClearCommand.php @@ -4,6 +4,7 @@ use Illuminate\Console\Command; use Illuminate\Cache\CacheManager; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; class ClearCommand extends Command @@ -47,17 +48,23 @@ public function __construct(CacheManager $cache) * * @return void */ - public function fire() + public function handle() { - $storeName = $this->argument('store'); + $tags = array_filter(explode(',', $this->option('tags'))); - $this->laravel['events']->fire('cache:clearing', [$storeName]); + $cache = $this->cache->store($store = $this->argument('store')); - $this->cache->store($storeName)->flush(); + $this->laravel['events']->fire('cache:clearing', [$store, $tags]); - $this->laravel['events']->fire('cache:cleared', [$storeName]); + if (! empty($tags)) { + $cache->tags($tags)->flush(); + } else { + $cache->flush(); + } - $this->info('Application cache cleared!'); + $this->info('Cache cleared successfully.'); + + $this->laravel['events']->fire('cache:cleared', [$store, $tags]); } /** @@ -71,4 +78,16 @@ protected function getArguments() ['store', InputArgument::OPTIONAL, 'The name of the store you would like to clear.'], ]; } + + /** + * Get the console command options. + * + * @return array + */ + protected function getOptions() + { + return [ + ['tags', null, InputOption::VALUE_OPTIONAL, 'The cache tags you would like to clear.', null], + ]; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php old mode 100644 new mode 100755 index 20f20c7..b2382cb --- a/application/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/DatabaseStore.php @@ -10,6 +10,8 @@ class DatabaseStore implements Store { + use RetrievesMultipleKeys; + /** * The database connection instance. * @@ -58,7 +60,7 @@ public function __construct(ConnectionInterface $connection, EncrypterContract $ /** * Retrieve an item from the cache by key. * - * @param string $key + * @param string|array $key * @return mixed */ public function get($key) @@ -126,7 +128,7 @@ public function increment($key, $value = 1) } /** - * Increment the value of an item in the cache. + * Decrement the value of an item in the cache. * * @param string $key * @param mixed $value @@ -158,6 +160,10 @@ protected function incrementOrDecrement($key, $value, Closure $callback) return false; } + if (is_array($cache)) { + $cache = (object) $cache; + } + $current = $this->encrypter->decrypt($cache->value); $new = $callback((int) $current, $value); diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php new file mode 100644 index 0000000..2e846a4 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheHit.php @@ -0,0 +1,42 @@ +key = $key; + $this->tags = $tags; + $this->value = $value; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php new file mode 100644 index 0000000..2e2b2ff --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/CacheMissed.php @@ -0,0 +1,33 @@ +key = $key; + $this->tags = $tags; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Events/KeyForgotten.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/KeyForgotten.php new file mode 100644 index 0000000..495bed5 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/KeyForgotten.php @@ -0,0 +1,33 @@ +key = $key; + $this->tags = $tags; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Events/KeyWritten.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/KeyWritten.php new file mode 100644 index 0000000..7f5fc73 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Events/KeyWritten.php @@ -0,0 +1,51 @@ +key = $key; + $this->tags = $tags; + $this->value = $value; + $this->minutes = $minutes; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php old mode 100644 new mode 100755 index 05f3eda..b21ba6c --- a/application/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php @@ -4,11 +4,13 @@ use Exception; use Illuminate\Support\Arr; -use Illuminate\Contracts\Cache\Store; use Illuminate\Filesystem\Filesystem; +use Illuminate\Contracts\Cache\Store; class FileStore implements Store { + use RetrievesMultipleKeys; + /** * The Illuminate Filesystem instance. * @@ -39,7 +41,7 @@ public function __construct(Filesystem $files, $directory) /** * Retrieve an item from the cache by key. * - * @param string $key + * @param string|array $key * @return mixed */ public function get($key) @@ -61,7 +63,9 @@ protected function getPayload($key) // just return null. Otherwise, we'll get the contents of the file and get // the expiration UNIX timestamps from the start of the file's contents. try { - $expire = substr($contents = $this->files->get($path), 0, 10); + $expire = substr( + $contents = $this->files->get($path, true), 0, 10 + ); } catch (Exception $e) { return ['data' => null, 'time' => null]; } @@ -99,7 +103,7 @@ public function put($key, $value, $minutes) $this->createCacheDirectory($path = $this->path($key)); - $this->files->put($path, $value); + $this->files->put($path, $value, true); } /** @@ -196,7 +200,7 @@ public function flush() */ protected function path($key) { - $parts = array_slice(str_split($hash = md5($key), 2), 0, 2); + $parts = array_slice(str_split($hash = sha1($key), 2), 0, 2); return $this->directory.'/'.implode('/', $parts).'/'.$hash; } @@ -215,7 +219,7 @@ protected function expiration($minutes) return 9999999999; } - return $time; + return (int) $time; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php b/application/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php old mode 100644 new mode 100755 index 2c2aee0..156bcdc --- a/application/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php @@ -2,6 +2,7 @@ namespace Illuminate\Cache; +use Memcached; use Illuminate\Contracts\Cache\Store; class MemcachedStore extends TaggableStore implements Store @@ -36,7 +37,7 @@ public function __construct($memcached, $prefix = '') /** * Retrieve an item from the cache by key. * - * @param string $key + * @param string|array $key * @return mixed */ public function get($key) @@ -48,6 +49,29 @@ public function get($key) } } + /** + * Retrieve multiple items from the cache by key. + * + * Items not found in the cache will have a null value. + * + * @param array $keys + * @return array + */ + public function many(array $keys) + { + $prefixedKeys = array_map(function ($key) { + return $this->prefix.$key; + }, $keys); + + $values = $this->memcached->getMulti($prefixedKeys, null, Memcached::GET_PRESERVE_ORDER); + + if ($this->memcached->getResultCode() != 0) { + return array_fill_keys($keys, null); + } + + return array_combine($keys, $values); + } + /** * Store an item in the cache for a given number of minutes. * @@ -61,6 +85,24 @@ public function put($key, $value, $minutes) $this->memcached->set($this->prefix.$key, $value, $minutes * 60); } + /** + * Store multiple items in the cache for a given number of minutes. + * + * @param array $values + * @param int $minutes + * @return void + */ + public function putMany(array $values, $minutes) + { + $prefixedValues = []; + + foreach ($values as $key => $value) { + $prefixedValues[$this->prefix.$key] = $value; + } + + $this->memcached->setMulti($prefixedValues, $minutes * 60); + } + /** * Store an item in the cache if the key doesn't exist. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php old mode 100644 new mode 100755 index 46aed16..090ae4c --- a/application/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/NullStore.php @@ -6,6 +6,8 @@ class NullStore extends TaggableStore implements Store { + use RetrievesMultipleKeys; + /** * The array of stored values. * @@ -50,7 +52,7 @@ public function increment($key, $value = 1) } /** - * Increment the value of an item in the cache. + * Decrement the value of an item in the cache. * * @param string $key * @param mixed $value diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php b/application/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php index 4a9978c..497ceb1 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/RateLimiter.php @@ -34,12 +34,14 @@ public function __construct(Cache $cache) */ public function tooManyAttempts($key, $maxAttempts, $decayMinutes = 1) { - $lockedOut = $this->cache->has($key.':lockout'); + if ($this->cache->has($key.':lockout')) { + return true; + } + + if ($this->attempts($key) > $maxAttempts) { + $this->cache->add($key.':lockout', time() + ($decayMinutes * 60), $decayMinutes); - if ($this->attempts($key) > $maxAttempts || $lockedOut) { - if (! $lockedOut) { - $this->cache->add($key.':lockout', time() + ($decayMinutes * 60), $decayMinutes); - } + $this->resetAttempts($key); return true; } @@ -72,6 +74,31 @@ public function attempts($key) return $this->cache->get($key, 0); } + /** + * Reset the number of attempts for the given key. + * + * @param string $key + * @return mixed + */ + public function resetAttempts($key) + { + return $this->cache->forget($key); + } + + /** + * Get the number of retries left for the given key. + * + * @param string $key + * @param int $maxAttempts + * @return int + */ + public function retriesLeft($key, $maxAttempts) + { + $attempts = $this->attempts($key); + + return $attempts === 0 ? $maxAttempts : $maxAttempts - $attempts + 1; + } + /** * Clear the hits and lockout for the given key. * @@ -80,7 +107,7 @@ public function attempts($key) */ public function clear($key) { - $this->cache->forget($key); + $this->resetAttempts($key); $this->cache->forget($key.':lockout'); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php old mode 100644 new mode 100755 index aeea3f4..d3f2c97 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php @@ -46,7 +46,7 @@ public function __construct(Redis $redis, $prefix = '', $connection = 'default') /** * Retrieve an item from the cache by key. * - * @param string $key + * @param string|array $key * @return mixed */ public function get($key) @@ -56,6 +56,31 @@ public function get($key) } } + /** + * Retrieve multiple items from the cache by key. + * + * Items not found in the cache will have a null value. + * + * @param array $keys + * @return array + */ + public function many(array $keys) + { + $return = []; + + $prefixedKeys = array_map(function ($key) { + return $this->prefix.$key; + }, $keys); + + $values = $this->connection()->mget($prefixedKeys); + + foreach ($values as $index => $value) { + $return[$keys[$index]] = is_numeric($value) ? $value : unserialize($value); + } + + return $return; + } + /** * Store an item in the cache for a given number of minutes. * @@ -68,9 +93,25 @@ public function put($key, $value, $minutes) { $value = is_numeric($value) ? $value : serialize($value); - $minutes = max(1, $minutes); + $this->connection()->setex($this->prefix.$key, (int) max(1, $minutes * 60), $value); + } + + /** + * Store multiple items in the cache for a given number of minutes. + * + * @param array $values + * @param int $minutes + * @return void + */ + public function putMany(array $values, $minutes) + { + $this->connection()->multi(); + + foreach ($values as $key => $value) { + $this->put($key, $value, $minutes); + } - $this->connection()->setex($this->prefix.$key, $minutes * 60, $value); + $this->connection()->exec(); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/Repository.php b/application/vendor/laravel/framework/src/Illuminate/Cache/Repository.php old mode 100644 new mode 100755 index fb76105..b50ddd0 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/Repository.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/Repository.php @@ -70,8 +70,35 @@ public function setEventDispatcher(Dispatcher $events) */ protected function fireCacheEvent($event, $payload) { - if (isset($this->events)) { - $this->events->fire('cache.'.$event, $payload); + if (! isset($this->events)) { + return; + } + + switch ($event) { + case 'hit': + if (count($payload) == 2) { + $payload[] = []; + } + + return $this->events->fire(new Events\CacheHit($payload[0], $payload[1], $payload[2])); + case 'missed': + if (count($payload) == 1) { + $payload[] = []; + } + + return $this->events->fire(new Events\CacheMissed($payload[0], $payload[1])); + case 'delete': + if (count($payload) == 1) { + $payload[] = []; + } + + return $this->events->fire(new Events\KeyForgotten($payload[0], $payload[1])); + case 'write': + if (count($payload) == 3) { + $payload[] = []; + } + + return $this->events->fire(new Events\KeyWritten($payload[0], $payload[1], $payload[2], $payload[3])); } } @@ -95,6 +122,10 @@ public function has($key) */ public function get($key, $default = null) { + if (is_array($key)) { + return $this->many($key); + } + $value = $this->store->get($this->itemKey($key)); if (is_null($value)) { @@ -108,6 +139,37 @@ public function get($key, $default = null) return $value; } + /** + * Retrieve multiple items from the cache by key. + * + * Items not found in the cache will have a null value. + * + * @param array $keys + * @return array + */ + public function many(array $keys) + { + $normalizedKeys = []; + + foreach ($keys as $key => $value) { + $normalizedKeys[] = is_string($key) ? $key : $value; + } + + $values = $this->store->many($normalizedKeys); + + foreach ($values as $key => &$value) { + if (is_null($value)) { + $this->fireCacheEvent('missed', [$key]); + + $value = isset($keys[$key]) ? value($keys[$key]) : null; + } else { + $this->fireCacheEvent('hit', [$key, $value]); + } + } + + return $values; + } + /** * Retrieve an item from the cache and delete it. * @@ -132,8 +194,12 @@ public function pull($key, $default = null) * @param \DateTime|int $minutes * @return void */ - public function put($key, $value, $minutes) + public function put($key, $value, $minutes = null) { + if (is_array($key) && filter_var($value, FILTER_VALIDATE_INT) !== false) { + return $this->putMany($key, $value); + } + $minutes = $this->getMinutes($minutes); if (! is_null($minutes)) { @@ -143,6 +209,26 @@ public function put($key, $value, $minutes) } } + /** + * Store multiple items in the cache for a given number of minutes. + * + * @param array $values + * @param int $minutes + * @return void + */ + public function putMany(array $values, $minutes) + { + $minutes = $this->getMinutes($minutes); + + if (! is_null($minutes)) { + $this->store->putMany($values, $minutes); + + foreach ($values as $key => $value) { + $this->fireCacheEvent('write', [$key, $value, $minutes]); + } + } + } + /** * Store an item in the cache if the key does not exist. * @@ -256,19 +342,6 @@ public function forget($key) return $success; } - /** - * Begin executing a new tags operation if the store supports it. - * - * @param string $name - * @return \Illuminate\Cache\TaggedCache - * - * @deprecated since version 5.1. Use tags instead. - */ - public function section($name) - { - return $this->tags($name); - } - /** * Begin executing a new tags operation if the store supports it. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php b/application/vendor/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php new file mode 100644 index 0000000..485d185 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/RetrievesMultipleKeys.php @@ -0,0 +1,39 @@ +get($key); + } + + return $return; + } + + /** + * Store multiple items in the cache for a given number of minutes. + * + * @param array $values + * @param int $minutes + * @return void + */ + public function putMany(array $values, $minutes) + { + foreach ($values as $key => $value) { + $this->put($key, $value, $minutes); + } + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php index 4479fcc..ba00fa4 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/TaggableStore.php @@ -4,19 +4,6 @@ abstract class TaggableStore { - /** - * Begin executing a new tags operation. - * - * @param string $name - * @return \Illuminate\Cache\TaggedCache - * - * @deprecated since version 5.1. Use tags instead. - */ - public function section($name) - { - return $this->tags($name); - } - /** * Begin executing a new tags operation. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php b/application/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php index c1cfec8..0cbba7e 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php @@ -6,6 +6,8 @@ class TaggedCache extends Repository { + use RetrievesMultipleKeys; + /** * The tag set instance. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php deleted file mode 100644 index 6dc3fc7..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/WinCacheStore.php +++ /dev/null @@ -1,121 +0,0 @@ -prefix = $prefix; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @return mixed - */ - public function get($key) - { - $value = wincache_ucache_get($this->prefix.$key); - - if ($value !== false) { - return $value; - } - } - - /** - * Store an item in the cache for a given number of minutes. - * - * @param string $key - * @param mixed $value - * @param int $minutes - * @return void - */ - public function put($key, $value, $minutes) - { - wincache_ucache_set($this->prefix.$key, $value, $minutes * 60); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1) - { - return wincache_ucache_inc($this->prefix.$key, $value); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1) - { - return wincache_ucache_dec($this->prefix.$key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function forever($key, $value) - { - $this->put($key, $value, 0); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return wincache_ucache_delete($this->prefix.$key); - } - - /** - * Remove all items from the cache. - * - * @return void - */ - public function flush() - { - wincache_ucache_clear(); - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php b/application/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php deleted file mode 100644 index 7ef64cf..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/XCacheStore.php +++ /dev/null @@ -1,121 +0,0 @@ -prefix = $prefix; - } - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @return mixed - */ - public function get($key) - { - $value = xcache_get($this->prefix.$key); - - if (isset($value)) { - return $value; - } - } - - /** - * Store an item in the cache for a given number of minutes. - * - * @param string $key - * @param mixed $value - * @param int $minutes - * @return void - */ - public function put($key, $value, $minutes) - { - xcache_set($this->prefix.$key, $value, $minutes * 60); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function increment($key, $value = 1) - { - return xcache_inc($this->prefix.$key, $value); - } - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int - */ - public function decrement($key, $value = 1) - { - return xcache_dec($this->prefix.$key, $value); - } - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function forever($key, $value) - { - return $this->put($key, $value, 0); - } - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key) - { - return xcache_unset($this->prefix.$key); - } - - /** - * Remove all items from the cache. - * - * @return void - */ - public function flush() - { - xcache_clear_cache(XC_TYPE_VAR); - } - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Cache/composer.json b/application/vendor/laravel/framework/src/Illuminate/Cache/composer.json old mode 100644 new mode 100755 index 51ee8ac..8ae4873 --- a/application/vendor/laravel/framework/src/Illuminate/Cache/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Cache/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "nesbot/carbon": "~1.19" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "nesbot/carbon": "~1.20" }, "autoload": { "psr-4": { @@ -26,13 +26,13 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { - "illuminate/database": "Required to use the database cache driver (5.1.*).", - "illuminate/filesystem": "Required to use the file cache driver (5.1.*).", - "illuminate/redis": "Required to use the redis cache driver (5.1.*)." + "illuminate/database": "Required to use the database cache driver (5.2.*).", + "illuminate/filesystem": "Required to use the file cache driver (5.2.*).", + "illuminate/redis": "Required to use the redis cache driver (5.2.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Config/composer.json b/application/vendor/laravel/framework/src/Illuminate/Config/composer.json old mode 100644 new mode 100755 index b4c4f23..05fd2e9 --- a/application/vendor/laravel/framework/src/Illuminate/Config/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Config/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/filesystem": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/contracts": "5.2.*", + "illuminate/filesystem": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Application.php b/application/vendor/laravel/framework/src/Illuminate/Console/Application.php old mode 100644 new mode 100755 index ee45c0a..a6deeb6 --- a/application/vendor/laravel/framework/src/Illuminate/Console/Application.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Application.php @@ -43,7 +43,7 @@ public function __construct(Container $laravel, Dispatcher $events, $version) $this->setAutoExit(false); $this->setCatchExceptions(false); - $events->fire('artisan.start', [$this]); + $events->fire(new Events\ArtisanStarting($this)); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Command.php b/application/vendor/laravel/framework/src/Illuminate/Console/Command.php old mode 100644 new mode 100755 index 47b79d0..44d429e --- a/application/vendor/laravel/framework/src/Illuminate/Console/Command.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Command.php @@ -12,7 +12,6 @@ use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Command\Command as SymfonyCommand; -use Illuminate\Contracts\Foundation\Application as LaravelApplication; class Command extends SymfonyCommand { @@ -58,6 +57,26 @@ class Command extends SymfonyCommand */ protected $description; + /** + * The default verbosity of output commands. + * + * @var int + */ + protected $verbosity = OutputInterface::VERBOSITY_NORMAL; + + /** + * The mapping between human readable verbosity levels and Symfony's OutputInterface. + * + * @var array + */ + protected $verbosityMap = [ + 'v' => OutputInterface::VERBOSITY_VERBOSE, + 'vv' => OutputInterface::VERBOSITY_VERY_VERBOSE, + 'vvv' => OutputInterface::VERBOSITY_DEBUG, + 'quiet' => OutputInterface::VERBOSITY_QUIET, + 'normal' => OutputInterface::VERBOSITY_NORMAL, + ]; + /** * Create a new console command instance. * @@ -182,6 +201,17 @@ public function callSilent($command, array $arguments = []) return $instance->run(new ArrayInput($arguments), new NullOutput); } + /** + * Determine if the given argument is present. + * + * @param string|int $name + * @return bool + */ + public function hasArgument($name) + { + return $this->input->hasArgument($name); + } + /** * Get the value of a command argument. * @@ -197,6 +227,17 @@ public function argument($key = null) return $this->input->getArgument($key); } + /** + * Determine if the given option is present. + * + * @param string $name + * @return bool + */ + public function hasOption($name) + { + return $this->input->hasOption($name); + } + /** * Get the value of a command option. * @@ -324,64 +365,73 @@ public function table(array $headers, $rows, $style = 'default') * Write a string as information output. * * @param string $string + * @param null|int|string $verbosity * @return void */ - public function info($string) + public function info($string, $verbosity = null) { - $this->output->writeln("$string"); + $this->line($string, 'info', $verbosity); } /** * Write a string as standard output. * * @param string $string + * @param string $style + * @param null|int|string $verbosity * @return void */ - public function line($string) + public function line($string, $style = null, $verbosity = null) { - $this->output->writeln($string); + $styled = $style ? "<$style>$string" : $string; + + $this->output->writeln($styled, $this->parseVerbosity($verbosity)); } /** * Write a string as comment output. * * @param string $string + * @param null|int|string $verbosity * @return void */ - public function comment($string) + public function comment($string, $verbosity = null) { - $this->output->writeln("$string"); + $this->line($string, 'comment', $verbosity); } /** * Write a string as question output. * * @param string $string + * @param null|int|string $verbosity * @return void */ - public function question($string) + public function question($string, $verbosity = null) { - $this->output->writeln("$string"); + $this->line($string, 'question', $verbosity); } /** * Write a string as error output. * * @param string $string + * @param null|int|string $verbosity * @return void */ - public function error($string) + public function error($string, $verbosity = null) { - $this->output->writeln("$string"); + $this->line($string, 'error', $verbosity); } /** * Write a string as warning output. * * @param string $string + * @param null|int|string $verbosity * @return void */ - public function warn($string) + public function warn($string, $verbosity = null) { if (! $this->output->getFormatter()->hasStyle('warning')) { $style = new OutputFormatterStyle('yellow'); @@ -389,7 +439,35 @@ public function warn($string) $this->output->getFormatter()->setStyle('warning', $style); } - $this->output->writeln("$string"); + $this->line($string, 'warning', $verbosity); + } + + /** + * Get the verbosity level in terms of Symfony's OutputInterface level. + * + * @param string|int $level + * @return int + */ + protected function parseVerbosity($level = null) + { + if (isset($this->verbosityMap[$level])) { + $level = $this->verbosityMap[$level]; + } elseif (! is_int($level)) { + $level = $this->verbosity; + } + + return $level; + } + + /** + * Set the verbosity level. + * + * @param string|int $level + * @return void + */ + protected function setVerbosity($level) + { + $this->verbosity = $this->parseVerbosity($level); } /** @@ -435,10 +513,10 @@ public function getLaravel() /** * Set the Laravel application instance. * - * @param \Illuminate\Contracts\Foundation\Application $laravel + * @param \Illuminate\Contracts\Container\Container $laravel * @return void */ - public function setLaravel(LaravelApplication $laravel) + public function setLaravel($laravel) { $this->laravel = $laravel; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php b/application/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php index 30f4402..56d9bd9 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/ConfirmableTrait.php @@ -9,9 +9,7 @@ trait ConfirmableTrait /** * Confirm before proceeding with the action. * - * This method only asks for confirmation in production. - * - * @param string $warning + * @param string $warning * @param \Closure|bool|null $callback * @return bool */ diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Events/ArtisanStarting.php b/application/vendor/laravel/framework/src/Illuminate/Console/Events/ArtisanStarting.php new file mode 100644 index 0000000..f228ac5 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Events/ArtisanStarting.php @@ -0,0 +1,24 @@ +artisan = $artisan; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Parser.php b/application/vendor/laravel/framework/src/Illuminate/Console/Parser.php index babba0e..3325c6c 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Console/Parser.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Parser.php @@ -14,6 +14,8 @@ class Parser * * @param string $expression * @return array + * + * @throws \InvalidArgumentException */ public static function parse($expression) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php index 494f0e8..9719cfa 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -28,17 +28,19 @@ class CallbackEvent extends Event * @param string $callback * @param array $parameters * @return void + * + * @throws \InvalidArgumentException */ public function __construct($callback, array $parameters = []) { - $this->callback = $callback; - $this->parameters = $parameters; - - if (! is_string($this->callback) && ! is_callable($this->callback)) { + if (! is_string($callback) && ! is_callable($callback)) { throw new InvalidArgumentException( 'Invalid scheduled callback event. Must be string or callable.' ); } + + $this->callback = $callback; + $this->parameters = $parameters; } /** @@ -82,6 +84,8 @@ protected function removeMutex() * Do not allow the event to overlap each other. * * @return $this + * + * @throws \LogicException */ public function withoutOverlapping() { @@ -103,7 +107,7 @@ public function withoutOverlapping() */ protected function mutexPath() { - return storage_path('framework/schedule-'.md5($this->description)); + return storage_path('framework/schedule-'.sha1($this->description)); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php index 6fee7ed..ae10b0a 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php @@ -11,7 +11,6 @@ use Symfony\Component\Process\Process; use Symfony\Component\Process\ProcessUtils; use Illuminate\Contracts\Container\Container; -use Illuminate\Contracts\Foundation\Application; class Event { @@ -65,18 +64,25 @@ class Event public $withoutOverlapping = false; /** - * The filter callback. + * Indicates if the command should run in background. * - * @var \Closure + * @var bool */ - protected $filter; + public $runInBackground = false; /** - * The reject callback. + * The array of filter callbacks. * - * @var \Closure + * @var array */ - protected $reject; + protected $filters = []; + + /** + * The array of reject callbacks. + * + * @var array + */ + protected $rejects = []; /** * The location that output should be sent to. @@ -143,25 +149,13 @@ protected function getDefaultOutput() */ public function run(Container $container) { - if (count($this->afterCallbacks) > 0 || count($this->beforeCallbacks) > 0) { + if (! $this->runInBackground) { $this->runCommandInForeground($container); } else { $this->runCommandInBackground(); } } - /** - * Run the command in the background using exec. - * - * @return void - */ - protected function runCommandInBackground() - { - chdir(base_path()); - - exec($this->buildCommand()); - } - /** * Run the command in the foreground. * @@ -179,6 +173,18 @@ protected function runCommandInForeground(Container $container) $this->callAfterCallbacks($container); } + /** + * Run the command in the background. + * + * @return void + */ + protected function runCommandInBackground() + { + (new Process( + $this->buildCommand(), base_path(), null, null, null + ))->run(); + } + /** * Call all of the "before" callbacks for the event. * @@ -236,7 +242,7 @@ public function buildCommand() */ protected function mutexPath() { - return storage_path('framework/schedule-'.md5($this->expression.$this->command)); + return storage_path('framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($this->expression.$this->command)); } /** @@ -245,14 +251,13 @@ protected function mutexPath() * @param \Illuminate\Contracts\Foundation\Application $app * @return bool */ - public function isDue(Application $app) + public function isDue($app) { if (! $this->runsInMaintenanceMode() && $app->isDownForMaintenance()) { return false; } return $this->expressionPasses() && - $this->filtersPass($app) && $this->runsInEnvironment($app->environment()); } @@ -278,11 +283,18 @@ protected function expressionPasses() * @param \Illuminate\Contracts\Foundation\Application $app * @return bool */ - protected function filtersPass(Application $app) + public function filtersPass($app) { - if (($this->filter && ! $app->call($this->filter)) || - $this->reject && $app->call($this->reject)) { - return false; + foreach ($this->filters as $callback) { + if (! $app->call($callback)) { + return false; + } + } + + foreach ($this->rejects as $callback) { + if ($app->call($callback)) { + return false; + } } return true; @@ -496,6 +508,30 @@ public function monthly() return $this->cron('0 0 1 * * *'); } + /** + * Schedule the event to run monthly on a given day and time. + * + * @param int $day + * @param string $time + * @return $this + */ + public function monthlyOn($day = 1, $time = '0:0') + { + $this->dailyAt($time); + + return $this->spliceIntoPosition(3, $day); + } + + /** + * Schedule the event to run quarterly. + * + * @return $this + */ + public function quarterly() + { + return $this->cron('0 0 1 */3 *'); + } + /** * Schedule the event to run yearly. * @@ -559,6 +595,18 @@ public function days($days) return $this->spliceIntoPosition(5, implode(',', $days)); } + /** + * State that the command should run in background. + * + * @return $this + */ + public function runInBackground() + { + $this->runInBackground = true; + + return $this; + } + /** * Set the timezone the date should be evaluated on. * @@ -632,7 +680,7 @@ public function withoutOverlapping() */ public function when(Closure $callback) { - $this->filter = $callback; + $this->filters[] = $callback; return $this; } @@ -645,7 +693,7 @@ public function when(Closure $callback) */ public function skip(Closure $callback) { - $this->reject = $callback; + $this->rejects[] = $callback; return $this; } @@ -681,11 +729,12 @@ public function appendOutputTo($location) * E-mail the results of the scheduled operation. * * @param array|mixed $addresses + * @param bool $onlyIfOutputExists * @return $this * * @throws \LogicException */ - public function emailOutputTo($addresses) + public function emailOutputTo($addresses, $onlyIfOutputExists = false) { if (is_null($this->output) || $this->output == $this->getDefaultOutput()) { throw new LogicException('Must direct output to a file in order to e-mail results.'); @@ -693,21 +742,41 @@ public function emailOutputTo($addresses) $addresses = is_array($addresses) ? $addresses : func_get_args(); - return $this->then(function (Mailer $mailer) use ($addresses) { - $this->emailOutput($mailer, $addresses); + return $this->then(function (Mailer $mailer) use ($addresses, $onlyIfOutputExists) { + $this->emailOutput($mailer, $addresses, $onlyIfOutputExists); }); } + /** + * E-mail the results of the scheduled operation if it produces output. + * + * @param array|mixed $addresses + * @return $this + * + * @throws \LogicException + */ + public function emailWrittenOutputTo($addresses) + { + return $this->emailOutputTo($addresses, true); + } + /** * E-mail the output of the event to the recipients. * * @param \Illuminate\Contracts\Mail\Mailer $mailer * @param array $addresses + * @param bool $onlyIfOutputExists * @return void */ - protected function emailOutput(Mailer $mailer, $addresses) + protected function emailOutput(Mailer $mailer, $addresses, $onlyIfOutputExists = false) { - $mailer->raw(file_get_contents($this->output), function ($m) use ($addresses) { + $text = file_get_contents($this->output); + + if ($onlyIfOutputExists && empty($text)) { + return; + } + + $mailer->raw($text, function ($m) use ($addresses) { $m->subject($this->getEmailSubject()); foreach ($addresses as $address) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php index 1f56b3d..b9bd265 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php @@ -3,7 +3,6 @@ namespace Illuminate\Console\Scheduling; use Symfony\Component\Process\ProcessUtils; -use Illuminate\Contracts\Foundation\Application; use Symfony\Component\Process\PhpExecutableFinder; class Schedule @@ -100,7 +99,7 @@ public function events() * @param \Illuminate\Contracts\Foundation\Application $app * @return array */ - public function dueEvents(Application $app) + public function dueEvents($app) { return array_filter($this->events, function ($event) use ($app) { return $event->isDue($app); diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php index 3ce658c..cfaca21 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php @@ -49,13 +49,21 @@ public function fire() { $events = $this->schedule->dueEvents($this->laravel); + $eventsRan = 0; + foreach ($events as $event) { + if (! $event->filtersPass($this->laravel)) { + continue; + } + $this->line('Running scheduled command: '.$event->getSummaryForDisplay()); $event->run($this->laravel); + + ++$eventsRan; } - if (count($events) === 0) { + if (count($events) === 0 || $eventsRan === 0) { $this->info('No scheduled commands are ready to run.'); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Console/composer.json b/application/vendor/laravel/framework/src/Illuminate/Console/composer.json old mode 100644 new mode 100755 index e7c8652..6ebe7f8 --- a/application/vendor/laravel/framework/src/Illuminate/Console/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Console/composer.json @@ -10,15 +10,15 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/console": "2.7.*", - "nesbot/carbon": "~1.19" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "nesbot/carbon": "~1.20", + "symfony/console": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -27,13 +27,13 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { "guzzlehttp/guzzle": "Required to use the ping methods on schedules (~5.3|~6.0).", "mtdowling/cron-expression": "Required to use scheduling component (~1.0).", - "symfony/process": "Required to use scheduling component (2.7.*)." + "symfony/process": "Required to use scheduling component (2.8.*|3.0.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Container/BindingResolutionException.php b/application/vendor/laravel/framework/src/Illuminate/Container/BindingResolutionException.php deleted file mode 100644 index 198963e..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Container/BindingResolutionException.php +++ /dev/null @@ -1,13 +0,0 @@ -normalize($concrete); + return new ContextualBindingBuilder($this, $concrete); } @@ -131,6 +133,8 @@ public function when($concrete) */ public function bound($abstract) { + $abstract = $this->normalize($abstract); + return isset($this->bindings[$abstract]) || isset($this->instances[$abstract]) || $this->isAlias($abstract); } @@ -142,6 +146,8 @@ public function bound($abstract) */ public function resolved($abstract) { + $abstract = $this->normalize($abstract); + if ($this->isAlias($abstract)) { $abstract = $this->getAlias($abstract); } @@ -157,7 +163,7 @@ public function resolved($abstract) */ public function isAlias($name) { - return isset($this->aliases[$name]); + return isset($this->aliases[$this->normalize($name)]); } /** @@ -170,6 +176,10 @@ public function isAlias($name) */ public function bind($abstract, $concrete = null, $shared = false) { + $abstract = $this->normalize($abstract); + + $concrete = $this->normalize($concrete); + // If the given types are actually an array, we will assume an alias is being // defined and will grab this "real" abstract class name and register this // alias with the container so that it can be used as a shortcut for it. @@ -180,8 +190,8 @@ public function bind($abstract, $concrete = null, $shared = false) } // If no concrete type was given, we will simply set the concrete type to the - // abstract type. This will allow concrete type to be registered as shared - // without being forced to state their classes in both of the parameter. + // abstract type. After that, the concrete type to be registered as shared + // without being forced to state their classes in both of the parameters. $this->dropStaleInstances($abstract); if (is_null($concrete)) { @@ -231,7 +241,7 @@ protected function getClosure($abstract, $concrete) */ public function addContextualBinding($concrete, $abstract, $implementation) { - $this->contextual[$concrete][$abstract] = $implementation; + $this->contextual[$this->normalize($concrete)][$this->normalize($abstract)] = $this->normalize($implementation); } /** @@ -283,20 +293,6 @@ public function share(Closure $closure) }; } - /** - * Bind a shared Closure into the container. - * - * @param string $abstract - * @param \Closure $closure - * @return void - * - * @deprecated since version 5.1. Use singleton instead. - */ - public function bindShared($abstract, Closure $closure) - { - $this->bind($abstract, $this->share($closure), true); - } - /** * "Extend" an abstract type in the container. * @@ -308,6 +304,8 @@ public function bindShared($abstract, Closure $closure) */ public function extend($abstract, Closure $closure) { + $abstract = $this->normalize($abstract); + if (isset($this->instances[$abstract])) { $this->instances[$abstract] = $closure($this->instances[$abstract], $this); @@ -326,6 +324,8 @@ public function extend($abstract, Closure $closure) */ public function instance($abstract, $instance) { + $abstract = $this->normalize($abstract); + // First, we will extract the alias from the abstract if it is an array so we // are using the correct name when binding the type. If we get an alias it // will be registered with the container so we can resolve it out later. @@ -366,7 +366,7 @@ public function tag($abstracts, $tags) } foreach ((array) $abstracts as $abstract) { - $this->tags[$tag][] = $abstract; + $this->tags[$tag][] = $this->normalize($abstract); } } } @@ -399,7 +399,7 @@ public function tagged($tag) */ public function alias($abstract, $alias) { - $this->aliases[$alias] = $abstract; + $this->aliases[$alias] = $this->normalize($abstract); } /** @@ -422,7 +422,7 @@ protected function extractAlias(array $definition) */ public function rebinding($abstract, Closure $callback) { - $this->reboundCallbacks[$abstract][] = $callback; + $this->reboundCallbacks[$this->normalize($abstract)][] = $callback; if ($this->bound($abstract)) { return $this->make($abstract); @@ -439,7 +439,7 @@ public function rebinding($abstract, Closure $callback) */ public function refresh($abstract, $target, $method) { - return $this->rebinding($abstract, function ($app, $instance) use ($target, $method) { + return $this->rebinding($this->normalize($abstract), function ($app, $instance) use ($target, $method) { $target->{$method}($instance); }); } @@ -515,11 +515,7 @@ public function call($callback, array $parameters = [], $defaultMethod = null) */ protected function isCallableWithAtSign($callback) { - if (! is_string($callback)) { - return false; - } - - return strpos($callback, '@') !== false; + return is_string($callback) && strpos($callback, '@') !== false; } /** @@ -533,7 +529,7 @@ protected function getMethodDependencies($callback, array $parameters = []) { $dependencies = []; - foreach ($this->getCallReflector($callback)->getParameters() as $key => $parameter) { + foreach ($this->getCallReflector($callback)->getParameters() as $parameter) { $this->addDependencyForCallParameter($parameter, $parameters, $dependencies); } @@ -587,6 +583,8 @@ protected function addDependencyForCallParameter(ReflectionParameter $parameter, * @param array $parameters * @param string|null $defaultMethod * @return mixed + * + * @throws \InvalidArgumentException */ protected function callClass($target, array $parameters = [], $defaultMethod = null) { @@ -613,7 +611,7 @@ protected function callClass($target, array $parameters = [], $defaultMethod = n */ public function make($abstract, array $parameters = []) { - $abstract = $this->getAlias($abstract); + $abstract = $this->getAlias($this->normalize($abstract)); // If an instance of the type is currently being managed as a singleton we'll // just return an existing instance instead of instantiating new instances @@ -670,11 +668,6 @@ protected function getConcrete($abstract) // assume each type is a concrete name and will attempt to resolve it as is // since the container should be able to resolve concretes automatically. if (! isset($this->bindings[$abstract])) { - if ($this->missingLeadingSlash($abstract) && - isset($this->bindings['\\'.$abstract])) { - $abstract = '\\'.$abstract; - } - return $abstract; } @@ -695,14 +688,14 @@ protected function getContextualConcrete($abstract) } /** - * Determine if the given abstract has a leading slash. + * Normalize the given class name by removing leading slashes. * - * @param string $abstract - * @return bool + * @param mixed $service + * @return mixed */ - protected function missingLeadingSlash($abstract) + protected function normalize($service) { - return is_string($abstract) && strpos($abstract, '\\') !== 0; + return is_string($service) ? ltrim($service, '\\') : $service; } /** @@ -744,9 +737,15 @@ public function build($concrete, array $parameters = []) // an abstract type such as an Interface of Abstract Class and there is // no binding registered for the abstractions so we need to bail out. if (! $reflector->isInstantiable()) { - $message = "Target [$concrete] is not instantiable."; + if (! empty($this->buildStack)) { + $previous = implode(', ', $this->buildStack); - throw new BindingResolutionContractException($message); + $message = "Target [$concrete] is not instantiable while building [$previous]."; + } else { + $message = "Target [$concrete] is not instantiable."; + } + + throw new BindingResolutionException($message); } $this->buildStack[] = $concrete; @@ -806,7 +805,7 @@ protected function getDependencies(array $parameters, array $primitives = []) } } - return (array) $dependencies; + return $dependencies; } /** @@ -819,13 +818,21 @@ protected function getDependencies(array $parameters, array $primitives = []) */ protected function resolveNonClass(ReflectionParameter $parameter) { + if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->name))) { + if ($concrete instanceof Closure) { + return call_user_func($concrete, $this); + } else { + return $concrete; + } + } + if ($parameter->isDefaultValueAvailable()) { return $parameter->getDefaultValue(); } $message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}"; - throw new BindingResolutionContractException($message); + throw new BindingResolutionException($message); } /** @@ -845,7 +852,7 @@ protected function resolveClass(ReflectionParameter $parameter) // If we can not resolve the class instance, we will check to see if the value // is optional, and if it is we will return the optional parameter value as // the value of the dependency, similarly to how we do this with scalars. - catch (BindingResolutionContractException $e) { + catch (BindingResolutionException $e) { if ($parameter->isOptional()) { return $parameter->getDefaultValue(); } @@ -886,7 +893,7 @@ public function resolving($abstract, Closure $callback = null) if ($callback === null && $abstract instanceof Closure) { $this->resolvingCallback($abstract); } else { - $this->resolvingCallbacks[$abstract][] = $callback; + $this->resolvingCallbacks[$this->normalize($abstract)][] = $callback; } } @@ -902,7 +909,7 @@ public function afterResolving($abstract, Closure $callback = null) if ($abstract instanceof Closure && $callback === null) { $this->afterResolvingCallback($abstract); } else { - $this->afterResolvingCallbacks[$abstract][] = $callback; + $this->afterResolvingCallbacks[$this->normalize($abstract)][] = $callback; } } @@ -1033,13 +1040,17 @@ protected function fireCallbackArray($object, array $callbacks) */ public function isShared($abstract) { - if (isset($this->bindings[$abstract]['shared'])) { - $shared = $this->bindings[$abstract]['shared']; - } else { - $shared = false; + $abstract = $this->normalize($abstract); + + if (isset($this->instances[$abstract])) { + return true; } - return isset($this->instances[$abstract]) || $shared === true; + if (! isset($this->bindings[$abstract]['shared'])) { + return false; + } + + return $this->bindings[$abstract]['shared'] === true; } /** @@ -1098,7 +1109,7 @@ protected function dropStaleInstances($abstract) */ public function forgetInstance($abstract) { - unset($this->instances[$abstract]); + unset($this->instances[$this->normalize($abstract)]); } /** @@ -1196,6 +1207,8 @@ public function offsetSet($key, $value) */ public function offsetUnset($key) { + $key = $this->normalize($key); + unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Container/composer.json b/application/vendor/laravel/framework/src/Illuminate/Container/composer.json old mode 100644 new mode 100755 index 567d018..67d6852 --- a/application/vendor/laravel/framework/src/Illuminate/Container/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Container/composer.json @@ -10,12 +10,12 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*" + "illuminate/contracts": "5.2.*" }, "autoload": { "psr-4": { @@ -24,7 +24,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php b/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php index 23e1ad2..04f3e5e 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php +++ b/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php @@ -30,6 +30,32 @@ public function define($ability, $callback); */ public function policy($class, $policy); + /** + * Register a callback to run before all Gate checks. + * + * @param callable $callback + * @return $this + */ + public function before(callable $callback); + + /** + * Determine if the given ability should be granted for the current user. + * + * @param string $ability + * @param array|mixed $arguments + * @return bool + */ + public function allows($ability, $arguments = []); + + /** + * Determine if the given ability should be denied for the current user. + * + * @param string $ability + * @param array|mixed $arguments + * @return bool + */ + public function denies($ability, $arguments = []); + /** * Determine if the given ability should be granted. * @@ -38,4 +64,12 @@ public function policy($class, $policy); * @return bool */ public function check($ability, $arguments = []); + + /** + * Get a guard instance for the given user. + * + * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user + * @return static + */ + public function forUser($user); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Authenticatable.php b/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Authenticatable.php index 42f1e40..ac4ed88 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Authenticatable.php +++ b/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Authenticatable.php @@ -4,6 +4,13 @@ interface Authenticatable { + /** + * Get the name of the unique identifier for the user. + * + * @return string + */ + public function getAuthIdentifierName(); + /** * Get the unique identifier for the user. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Factory.php b/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Factory.php new file mode 100644 index 0000000..3ee9c8c --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Factory.php @@ -0,0 +1,22 @@ +=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/http-kernel": "2.7.*", - "symfony/http-foundation": "2.7.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/http-kernel": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php b/application/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php old mode 100644 new mode 100755 index 1a14401..5800df0 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php @@ -33,7 +33,7 @@ public function __construct(Container $container = null) // Once we have the container setup, we will setup the default configuration // options in the container "config" binding. This will make the database - // manager behave correctly since all the correct binding are in place. + // manager work correctly out of the box without extreme configuration. $this->setupDefaultConfiguration(); $this->setupManager(); @@ -135,7 +135,7 @@ public function bootEloquent() // If we have an event dispatcher instance, we will go ahead and register it // with the Eloquent ORM, allowing for model callbacks while creating and - // updating "model" instances; however, if it not necessary to operate. + // updating "model" instances; however, it is not necessary to operate. if ($dispatcher = $this->getEventDispatcher()) { Eloquent::setEventDispatcher($dispatcher); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connection.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connection.php old mode 100644 new mode 100755 index cc46b2e..99f23d2 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Connection.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Connection.php @@ -12,8 +12,8 @@ use Illuminate\Support\Arr; use Illuminate\Database\Query\Expression; use Illuminate\Contracts\Events\Dispatcher; -use Doctrine\DBAL\Connection as DoctrineConnection; use Illuminate\Database\Query\Processors\Processor; +use Doctrine\DBAL\Connection as DoctrineConnection; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\Schema\Builder as SchemaBuilder; use Illuminate\Database\Query\Grammars\Grammar as QueryGrammar; @@ -78,6 +78,20 @@ class Connection implements ConnectionInterface */ protected $fetchMode = PDO::FETCH_OBJ; + /** + * The argument for the fetch mode. + * + * @var mixed + */ + protected $fetchArgument; + + /** + * The constructor arguments for the PDO::FETCH_CLASS fetch mode. + * + * @var array + */ + protected $fetchConstructorArgument = []; + /** * The number of active transactions. * @@ -137,13 +151,13 @@ class Connection implements ConnectionInterface /** * Create a new database connection instance. * - * @param \PDO $pdo + * @param \PDO|\Closure $pdo * @param string $database * @param string $tablePrefix * @param array $config * @return void */ - public function __construct(PDO $pdo, $database = '', $tablePrefix = '', array $config = []) + public function __construct($pdo, $database = '', $tablePrefix = '', array $config = []) { $this->pdo = $pdo; @@ -320,10 +334,63 @@ public function select($query, $bindings = [], $useReadPdo = true) $statement->execute($me->prepareBindings($bindings)); - return $statement->fetchAll($me->getFetchMode()); + $fetchMode = $me->getFetchMode(); + $fetchArgument = $me->getFetchArgument(); + $fetchConstructorArgument = $me->getFetchConstructorArgument(); + + if ($fetchMode === PDO::FETCH_CLASS && ! isset($fetchArgument)) { + $fetchArgument = 'StdClass'; + $fetchConstructorArgument = null; + } + + return isset($fetchArgument) + ? $statement->fetchAll($fetchMode, $fetchArgument, $fetchConstructorArgument) + : $statement->fetchAll($fetchMode); }); } + /** + * Run a select statement against the database and returns a generator. + * + * @param string $query + * @param array $bindings + * @param bool $useReadPdo + * @return \Generator + */ + public function cursor($query, $bindings = [], $useReadPdo = true) + { + $statement = $this->run($query, $bindings, function ($me, $query, $bindings) use ($useReadPdo) { + if ($me->pretending()) { + return []; + } + + $statement = $this->getPdoForSelect($useReadPdo)->prepare($query); + + $fetchMode = $me->getFetchMode(); + $fetchArgument = $me->getFetchArgument(); + $fetchConstructorArgument = $me->getFetchConstructorArgument(); + + if ($fetchMode === PDO::FETCH_CLASS && ! isset($fetchArgument)) { + $fetchArgument = 'StdClass'; + $fetchConstructorArgument = null; + } + + if (isset($fetchArgument)) { + $statement->setFetchMode($fetchMode, $fetchArgument, $fetchConstructorArgument); + } else { + $statement->setFetchMode($fetchMode); + } + + $statement->execute($me->prepareBindings($bindings)); + + return $statement; + }); + + while ($record = $statement->fetch()) { + yield $record; + } + } + /** * Get the PDO connection to use for a select query. * @@ -463,7 +530,7 @@ public function prepareBindings(array $bindings) * @param \Closure $callback * @return mixed * - * @throws \Throwable + * @throws \Exception|\Throwable */ public function transaction(Closure $callback) { @@ -498,30 +565,26 @@ public function transaction(Closure $callback) * Start a new database transaction. * * @return void - * - * @throws \Exception + * @throws Exception */ public function beginTransaction() { - if ($this->transactions == 0) { + ++$this->transactions; + + if ($this->transactions == 1) { try { - $this->pdo->beginTransaction(); + $this->getPdo()->beginTransaction(); } catch (Exception $e) { - if ($this->causedByLostConnection($e)) { - $this->reconnect(); - $this->pdo->beginTransaction(); - } else { - throw $e; - } + --$this->transactions; + + throw $e; } - } elseif ($this->transactions >= 1 && $this->queryGrammar->supportsSavepoints()) { - $this->pdo->exec( - $this->queryGrammar->compileSavepoint('trans'.($this->transactions + 1)) + } elseif ($this->transactions > 1 && $this->queryGrammar->supportsSavepoints()) { + $this->getPdo()->exec( + $this->queryGrammar->compileSavepoint('trans'.$this->transactions) ); } - ++$this->transactions; - $this->fireConnectionEvent('beganTransaction'); } @@ -533,10 +596,10 @@ public function beginTransaction() public function commit() { if ($this->transactions == 1) { - $this->pdo->commit(); + $this->getPdo()->commit(); } - --$this->transactions; + $this->transactions = max(0, $this->transactions - 1); $this->fireConnectionEvent('committed'); } @@ -549,9 +612,9 @@ public function commit() public function rollBack() { if ($this->transactions == 1) { - $this->pdo->rollBack(); + $this->getPdo()->rollBack(); } elseif ($this->transactions > 1 && $this->queryGrammar->supportsSavepoints()) { - $this->pdo->exec( + $this->getPdo()->exec( $this->queryGrammar->compileSavepointRollBack('trans'.$this->transactions) ); } @@ -742,14 +805,14 @@ protected function reconnectIfMissingConnection() public function logQuery($query, $bindings, $time = null) { if (isset($this->events)) { - $this->events->fire('illuminate.query', [$query, $bindings, $time, $this->getName()]); + $this->events->fire(new Events\QueryExecuted( + $query, $bindings, $time, $this + )); } - if (! $this->loggingQueries) { - return; + if ($this->loggingQueries) { + $this->queryLog[] = compact('query', 'bindings', 'time'); } - - $this->queryLog[] = compact('query', 'bindings', 'time'); } /** @@ -761,7 +824,7 @@ public function logQuery($query, $bindings, $time = null) public function listen(Closure $callback) { if (isset($this->events)) { - $this->events->listen('illuminate.query', $callback); + $this->events->listen(Events\QueryExecuted::class, $callback); } } @@ -773,8 +836,17 @@ public function listen(Closure $callback) */ protected function fireConnectionEvent($event) { - if (isset($this->events)) { - $this->events->fire('connection.'.$this->getName().'.'.$event, $this); + if (! isset($this->events)) { + return; + } + + switch ($event) { + case 'beganTransaction': + return $this->events->fire(new Events\TransactionBeginning($this)); + case 'committed': + return $this->events->fire(new Events\TransactionCommitted($this)); + case 'rollingBack': + return $this->events->fire(new Events\TransactionRolledBack($this)); } } @@ -833,7 +905,7 @@ public function getDoctrineConnection() if (is_null($this->doctrineConnection)) { $driver = $this->getDoctrineDriver(); - $data = ['pdo' => $this->pdo, 'dbname' => $this->getConfig('database')]; + $data = ['pdo' => $this->getPdo(), 'dbname' => $this->getConfig('database')]; $this->doctrineConnection = new DoctrineConnection($data, $driver); } @@ -848,6 +920,10 @@ public function getDoctrineConnection() */ public function getPdo() { + if ($this->pdo instanceof Closure) { + return $this->pdo = call_user_func($this->pdo); + } + return $this->pdo; } @@ -862,7 +938,7 @@ public function getReadPdo() return $this->getPdo(); } - return $this->readPdo ?: $this->pdo; + return $this->readPdo ?: $this->getPdo(); } /** @@ -938,7 +1014,7 @@ public function getConfig($option) */ public function getDriverName() { - return $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME); + return $this->getConfig('driver'); } /** @@ -1046,14 +1122,38 @@ public function getFetchMode() } /** - * Set the default fetch mode for the connection. + * Get the fetch argument to be applied when selecting. + * + * @return mixed + */ + public function getFetchArgument() + { + return $this->fetchArgument; + } + + /** + * Get custom constructor arguments for the PDO::FETCH_CLASS fetch mode. + * + * @return array + */ + public function getFetchConstructorArgument() + { + return $this->fetchConstructorArgument; + } + + /** + * Set the default fetch mode for the connection, and optional arguments for the given fetch mode. * * @param int $fetchMode + * @param mixed $fetchArgument + * @param array $fetchConstructorArgument * @return int */ - public function setFetchMode($fetchMode) + public function setFetchMode($fetchMode, $fetchArgument = null, array $fetchConstructorArgument = []) { $this->fetchMode = $fetchMode; + $this->fetchArgument = $fetchArgument; + $this->fetchConstructorArgument = $fetchConstructorArgument; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php b/application/vendor/laravel/framework/src/Illuminate/Database/ConnectionInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolver.php b/application/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolver.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php b/application/vendor/laravel/framework/src/Illuminate/Database/ConnectionResolverInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php old mode 100644 new mode 100755 index 6276e41..b46de39 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php @@ -57,7 +57,9 @@ public function make(array $config, $name = null) */ protected function createSingleConnection(array $config) { - $pdo = $this->createConnector($config)->connect($config); + $pdo = function () use ($config) { + return $this->createConnector($config)->connect($config); + }; return $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config); } @@ -196,7 +198,7 @@ public function createConnector(array $config) * Create a new connection instance. * * @param string $driver - * @param \PDO $connection + * @param \PDO|\Closure $connection * @param string $database * @param string $prefix * @param array $config @@ -204,7 +206,7 @@ public function createConnector(array $config) * * @throws \InvalidArgumentException */ - protected function createConnection($driver, PDO $connection, $database, $prefix = '', array $config = []) + protected function createConnection($driver, $connection, $database, $prefix = '', array $config = []) { if ($this->container->bound($key = "db.connection.{$driver}")) { return $this->container->make($key, [$connection, $database, $prefix, $config]); diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectorInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php old mode 100644 new mode 100755 index ca0de80..65f4b9a --- a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php @@ -2,6 +2,8 @@ namespace Illuminate\Database\Connectors; +use PDO; + class MySqlConnector extends Connector implements ConnectorInterface { /** @@ -21,7 +23,7 @@ public function connect(array $config) // connection's behavior, and some might be specified by the developers. $connection = $this->createConnection($dsn, $config, $options); - if (isset($config['unix_socket'])) { + if (! empty($config['database'])) { $connection->exec("use `{$config['database']}`;"); } @@ -47,16 +49,7 @@ public function connect(array $config) )->execute(); } - // If the "strict" option has been configured for the connection we will setup - // strict mode for this session. Strict mode enforces some extra rules when - // using the MySQL database system and is a quicker way to enforce them. - if (isset($config['strict'])) { - if ($config['strict']) { - $connection->prepare("set session sql_mode='STRICT_ALL_TABLES'")->execute(); - } else { - $connection->prepare("set session sql_mode=''")->execute(); - } - } + $this->setModes($connection, $config); return $connection; } @@ -110,4 +103,26 @@ protected function getHostDsn(array $config) ? "mysql:host={$host};port={$port};dbname={$database}" : "mysql:host={$host};dbname={$database}"; } + + /** + * Set the modes for the connection. + * + * @param \PDO $connection + * @param array $config + * @return void + */ + protected function setModes(PDO $connection, array $config) + { + if (isset($config['modes'])) { + $modes = implode(',', $config['modes']); + + $connection->prepare("set session sql_mode='".$modes."'")->execute(); + } elseif (isset($config['strict'])) { + if ($config['strict']) { + $connection->prepare("set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'")->execute(); + } else { + $connection->prepare("set session sql_mode='NO_ENGINE_SUBSTITUTION'")->execute(); + } + } + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php old mode 100644 new mode 100755 index 46e0b84..7a2a6c8 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php @@ -45,6 +45,8 @@ protected function getDsn(array $config) // need to establish the PDO connections and return them back for use. if (in_array('dblib', $this->getAvailableDrivers())) { return $this->getDblibDsn($config); + } elseif ($this->prefersOdbc($config)) { + return $this->getOdbcDsn($config); } else { return $this->getSqlSrvDsn($config); } @@ -70,6 +72,33 @@ protected function getDblibDsn(array $config) return $this->buildConnectString('dblib', $arguments); } + /** + * Determine if the database configuration prefers ODBC. + * + * @param array $config + * @return bool + */ + protected function prefersOdbc(array $config) + { + return in_array('odbc', $this->getAvailableDrivers()) && + array_get($config, 'odbc') === true; + } + + /** + * Get the DSN string for an ODBC connection. + * + * @param array $config + * @return string + */ + protected function getOdbcDsn(array $config) + { + if (isset($config['odbc_datasource_name'])) { + return 'odbc:'.$config['odbc_datasource_name']; + } + + return ''; + } + /** * Get the DSN string for a SqlSrv connection. * @@ -90,6 +119,14 @@ protected function getSqlSrvDsn(array $config) $arguments['APP'] = $config['appname']; } + if (isset($config['readonly'])) { + $arguments['ApplicationIntent'] = 'ReadOnly'; + } + + if (isset($config['pooling']) && $config['pooling'] === false) { + $arguments['ConnectionPooling'] = '0'; + } + return $this->buildConnectString('sqlsrv', $arguments); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php old mode 100644 new mode 100755 index f3459ac..5fca114 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/BaseCommand.php @@ -13,6 +13,6 @@ class BaseCommand extends Command */ protected function getMigrationPath() { - return $this->laravel->databasePath().'/migrations'; + return $this->laravel->databasePath().DIRECTORY_SEPARATOR.'migrations'; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/InstallCommand.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php old mode 100644 new mode 100755 index 920d417..38c51b6 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php @@ -71,7 +71,10 @@ public function fire() $path = $this->getMigrationPath(); } - $this->migrator->run($path, $pretend); + $this->migrator->run($path, [ + 'pretend' => $pretend, + 'step' => $this->input->getOption('step'), + ]); // Once the migrator has run we will grab the note output and send it out to // the console screen, since the migrator itself functions without having @@ -121,6 +124,8 @@ protected function getOptions() ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'], ['seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'], + + ['step', null, InputOption::VALUE_NONE, 'Force the migrations to be run so they can be rolled back individually.'], ]; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php index 8c78790..9858fa5 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php @@ -2,7 +2,7 @@ namespace Illuminate\Database\Console\Migrations; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Database\Migrations\MigrationCreator; class MigrateMakeCommand extends BaseCommand @@ -34,7 +34,7 @@ class MigrateMakeCommand extends BaseCommand /** * The Composer instance. * - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -42,7 +42,7 @@ class MigrateMakeCommand extends BaseCommand * Create a new migration install command instance. * * @param \Illuminate\Database\Migrations\MigrationCreator $creator - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(MigrationCreator $creator, Composer $composer) @@ -67,10 +67,12 @@ public function fire() $table = $this->input->getOption('table'); - $create = $this->input->getOption('create'); + $create = $this->input->getOption('create') ?: false; if (! $table && is_string($create)) { $table = $create; + + $create = true; } // Now we are ready to write the migration out to disk. Once we've written diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RefreshCommand.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/ResetCommand.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php index f74164b..a505de0 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeedCommand.php @@ -3,6 +3,7 @@ namespace Illuminate\Database\Console\Seeds; use Illuminate\Console\Command; +use Illuminate\Database\Eloquent\Model; use Illuminate\Console\ConfirmableTrait; use Symfony\Component\Console\Input\InputOption; use Illuminate\Database\ConnectionResolverInterface as Resolver; @@ -58,7 +59,9 @@ public function fire() $this->resolver->setDefaultConnection($this->getDatabase()); - $this->getSeeder()->run(); + Model::unguarded(function () { + $this->getSeeder()->run(); + }); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php index 06a83c1..3db79f1 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php @@ -2,7 +2,7 @@ namespace Illuminate\Database\Console\Seeds; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; use Illuminate\Console\GeneratorCommand; @@ -32,7 +32,7 @@ class SeederMakeCommand extends GeneratorCommand /** * The Composer instance. * - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -40,7 +40,7 @@ class SeederMakeCommand extends GeneratorCommand * Create a new command instance. * * @param \Illuminate\Filesystem\Filesystem $files - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(Filesystem $files, Composer $composer) diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php b/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php old mode 100644 new mode 100755 index 1a846e0..17f8bf6 --- a/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php @@ -2,6 +2,7 @@ namespace Illuminate\Database; +use PDO; use Illuminate\Support\Arr; use Illuminate\Support\Str; use InvalidArgumentException; @@ -262,6 +263,26 @@ public function setDefaultConnection($name) $this->app['config']['database.default'] = $name; } + /** + * Get all of the support drivers. + * + * @return array + */ + public function supportedDrivers() + { + return ['mysql', 'pgsql', 'sqlite', 'sqlsrv']; + } + + /** + * Get all of the drivers that are actually available. + * + * @return array + */ + public function availableDrivers() + { + return array_intersect($this->supportedDrivers(), str_replace('dblib', 'sqlsrv', PDO::getAvailableDrivers())); + } + /** * Register an extension connection resolver. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php old mode 100644 new mode 100755 index 64d9d4b..1129baa --- a/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php @@ -6,8 +6,8 @@ use Faker\Generator as FakerGenerator; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\ServiceProvider; -use Illuminate\Database\Connectors\ConnectionFactory; use Illuminate\Database\Eloquent\QueueEntityResolver; +use Illuminate\Database\Connectors\ConnectionFactory; use Illuminate\Database\Eloquent\Factory as EloquentFactory; class DatabaseServiceProvider extends ServiceProvider diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php old mode 100644 new mode 100755 index 5e45ba7..e54c4b0 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php @@ -55,9 +55,23 @@ class Builder */ protected $passthru = [ 'insert', 'insertGetId', 'getBindings', 'toSql', - 'exists', 'count', 'min', 'max', 'avg', 'sum', + 'exists', 'count', 'min', 'max', 'avg', 'sum', 'getConnection', ]; + /** + * Applied global scopes. + * + * @var array + */ + protected $scopes = []; + + /** + * Removed global scopes. + * + * @var array + */ + protected $removedScopes = []; + /** * Create a new Eloquent query builder instance. * @@ -69,12 +83,78 @@ public function __construct(QueryBuilder $query) $this->query = $query; } + /** + * Register a new global scope. + * + * @param string $identifier + * @param \Illuminate\Database\Eloquent\Scope|\Closure $scope + * @return $this + */ + public function withGlobalScope($identifier, $scope) + { + $this->scopes[$identifier] = $scope; + + if (method_exists($scope, 'extend')) { + $scope->extend($this); + } + + return $this; + } + + /** + * Remove a registered global scope. + * + * @param \Illuminate\Database\Eloquent\Scope|string $scope + * @return $this + */ + public function withoutGlobalScope($scope) + { + if (! is_string($scope)) { + $scope = get_class($scope); + } + + unset($this->scopes[$scope]); + + $this->removedScopes[] = $scope; + + return $this; + } + + /** + * Remove all or passed registered global scopes. + * + * @param array|null $scopes + * @return $this + */ + public function withoutGlobalScopes(array $scopes = null) + { + if (is_array($scopes)) { + foreach ($scopes as $scope) { + $this->withoutGlobalScope($scope); + } + } else { + $this->scopes = []; + } + + return $this; + } + + /** + * Get an array of global scopes that were removed from the query. + * + * @return array + */ + public function removedScopes() + { + return $this->removedScopes; + } + /** * Find a model by its primary key. * * @param mixed $id * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null + * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null */ public function find($id, $columns = ['*']) { @@ -88,7 +168,7 @@ public function find($id, $columns = ['*']) } /** - * Find a model by its primary key. + * Find multiple models by their primary keys. * * @param array $ids * @param array $columns @@ -231,16 +311,18 @@ public function firstOrFail($columns = ['*']) */ public function get($columns = ['*']) { - $models = $this->getModels($columns); + $builder = $this->applyScopes(); + + $models = $builder->getModels($columns); // If we actually found models we will also eager load any relationships that // have been specified as needing to be eager loaded, which will solve the // n+1 query issue for the developers to avoid running a lot of queries. if (count($models) > 0) { - $models = $this->eagerLoadRelations($models); + $models = $builder->eagerLoadRelations($models); } - return $this->model->newCollection($models); + return $builder->getModel()->newCollection($models); } /** @@ -259,18 +341,17 @@ public function value($column) } /** - * Get a single column's value from the first result of a query. - * - * This is an alias for the "value" method. + * Get a generator for the given query. * - * @param string $column - * @return mixed - * - * @deprecated since version 5.1. + * @return \Generator */ - public function pluck($column) + public function cursor() { - return $this->value($column); + $builder = $this->applyScopes(); + + foreach ($builder->query->cursor() as $record) { + yield $this->model->newFromBuilder($record); + } } /** @@ -300,6 +381,55 @@ public function chunk($count, callable $callback) return true; } + /** + * Chunk the results of a query by comparing numeric IDs. + * + * @param int $count + * @param callable $callback + * @param string $column + * @return bool + */ + public function chunkById($count, callable $callback, $column = 'id') + { + $lastId = null; + + $results = $this->forPageAfterId($count, 0, $column)->get(); + + while (! $results->isEmpty()) { + if (call_user_func($callback, $results) === false) { + return false; + } + + $lastId = $results->last()->{$column}; + + $results = $this->forPageAfterId($count, $lastId, $column)->get(); + } + + return true; + } + + /** + * Execute a callback over each item while chunking. + * + * @param callable $callback + * @param int $count + * @return bool + */ + public function each(callable $callback, $count = 1000) + { + if (is_null($this->query->orders) && is_null($this->query->unionOrders)) { + $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); + } + + return $this->chunk($count, function ($results) use ($callback) { + foreach ($results as $key => $value) { + if ($callback($value, $key) === false) { + return false; + } + } + }); + } + /** * Get an array with the values of a given column. * @@ -307,9 +437,9 @@ public function chunk($count, callable $callback) * @param string|null $key * @return \Illuminate\Support\Collection */ - public function lists($column, $key = null) + public function pluck($column, $key = null) { - $results = $this->query->lists($column, $key); + $results = $this->toBase()->pluck($column, $key); // If the model has a mutator for the requested column, we will spin through // the results and mutate the values so that the mutated version of these @@ -325,6 +455,20 @@ public function lists($column, $key = null) return collect($results); } + /** + * Alias for the "pluck" method. + * + * @param string $column + * @param string $key + * @return \Illuminate\Support\Collection + * + * @deprecated since version 5.2. Use the "pluck" method directly. + */ + public function lists($column, $key = null) + { + return $this->pluck($column, $key); + } + /** * Paginate the given query. * @@ -338,14 +482,17 @@ public function lists($column, $key = null) */ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { - $total = $this->query->getCountForPagination(); + $page = $page ?: Paginator::resolveCurrentPage($pageName); - $this->query->forPage( - $page = $page ?: Paginator::resolveCurrentPage($pageName), - $perPage = $perPage ?: $this->model->getPerPage() - ); + $perPage = $perPage ?: $this->model->getPerPage(); + + $query = $this->toBase(); + + $total = $query->getCountForPagination(); + + $results = $total ? $this->forPage($page, $perPage)->get($columns) : new Collection; - return new LengthAwarePaginator($this->get($columns), $total, $perPage, $page, [ + return new LengthAwarePaginator($results, $total, $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ]); @@ -357,11 +504,12 @@ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', * @param int $perPage * @param array $columns * @param string $pageName + * @param int|null $page * @return \Illuminate\Contracts\Pagination\Paginator */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page') + public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { - $page = Paginator::resolveCurrentPage($pageName); + $page = $page ?: Paginator::resolveCurrentPage($pageName); $perPage = $perPage ?: $this->model->getPerPage(); @@ -381,37 +529,37 @@ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'p */ public function update(array $values) { - return $this->query->update($this->addUpdatedAtColumn($values)); + return $this->toBase()->update($this->addUpdatedAtColumn($values)); } /** * Increment a column's value by a given amount. * * @param string $column - * @param int $amount - * @param array $extra + * @param int $amount + * @param array $extra * @return int */ public function increment($column, $amount = 1, array $extra = []) { $extra = $this->addUpdatedAtColumn($extra); - return $this->query->increment($column, $amount, $extra); + return $this->toBase()->increment($column, $amount, $extra); } /** * Decrement a column's value by a given amount. * * @param string $column - * @param int $amount - * @param array $extra + * @param int $amount + * @param array $extra * @return int */ public function decrement($column, $amount = 1, array $extra = []) { $extra = $this->addUpdatedAtColumn($extra); - return $this->query->decrement($column, $amount, $extra); + return $this->toBase()->decrement($column, $amount, $extra); } /** @@ -442,7 +590,7 @@ public function delete() return call_user_func($this->onDelete, $this); } - return $this->query->delete(); + return $this->toBase()->delete(); } /** @@ -504,8 +652,8 @@ public function eagerLoadRelations(array $models) /** * Eagerly load the relationship on a set of models. * - * @param array $models - * @param string $name + * @param array $models + * @param string $name * @param \Closure $constraints * @return array */ @@ -593,6 +741,24 @@ protected function isNested($name, $relation) return $dots && Str::startsWith($name, $relation.'.'); } + /** + * Apply the callback's query changes if the given "value" is true. + * + * @param bool $value + * @param \Closure $callback + * @return $this + */ + public function when($value, $callback) + { + $builder = $this; + + if ($value) { + $builder = call_user_func($callback, $builder); + } + + return $builder; + } + /** * Add a basic where clause to the query. * @@ -631,7 +797,7 @@ public function orWhere($column, $operator = null, $value = null) } /** - * Add a relationship count condition to the query. + * Add a relationship count / exists condition to the query. * * @param string $relation * @param string $operator @@ -648,17 +814,25 @@ public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', C $relation = $this->getHasRelationQuery($relation); - $query = $relation->getRelationCountQuery($relation->getRelated()->newQuery(), $this); + // If we only need to check for the existence of the relation, then we can + // optimize the subquery to only run a "where exists" clause instead of + // the full "count" clause. This will make the query run much faster. + $queryType = $this->shouldRunExistsQuery($operator, $count) + ? 'getRelationQuery' : 'getRelationCountQuery'; + + $query = $relation->{$queryType}($relation->getRelated()->newQuery(), $this); if ($callback) { - call_user_func($callback, $query); + $query->callScope($callback); } - return $this->addHasWhere($query, $relation, $operator, $count, $boolean); + return $this->addHasWhere( + $query, $relation, $operator, $count, $boolean + ); } /** - * Add nested relationship count conditions to the query. + * Add nested relationship count / exists conditions to the query. * * @param string $relations * @param string $operator @@ -686,7 +860,7 @@ protected function hasNested($relations, $operator = '>=', $count = 1, $boolean } /** - * Add a relationship count condition to the query. + * Add a relationship count / exists condition to the query. * * @param string $relation * @param string $boolean @@ -699,7 +873,7 @@ public function doesntHave($relation, $boolean = 'and', Closure $callback = null } /** - * Add a relationship count condition to the query with where clauses. + * Add a relationship count / exists condition to the query with where clauses. * * @param string $relation * @param \Closure $callback @@ -713,7 +887,7 @@ public function whereHas($relation, Closure $callback, $operator = '>=', $count } /** - * Add a relationship count condition to the query with where clauses. + * Add a relationship count / exists condition to the query with where clauses. * * @param string $relation * @param \Closure|null $callback @@ -725,7 +899,7 @@ public function whereDoesntHave($relation, Closure $callback = null) } /** - * Add a relationship count condition to the query with an "or". + * Add a relationship count / exists condition to the query with an "or". * * @param string $relation * @param string $operator @@ -738,7 +912,7 @@ public function orHas($relation, $operator = '>=', $count = 1) } /** - * Add a relationship count condition to the query with where clauses and an "or". + * Add a relationship count / exists condition to the query with where clauses and an "or". * * @param string $relation * @param \Closure $callback @@ -759,40 +933,71 @@ public function orWhereHas($relation, Closure $callback, $operator = '>=', $coun * @param string $operator * @param int $count * @param string $boolean - * @return \Illuminate\Database\Eloquent\Builder + * @return \Illuminate\Database\Eloquent\Builder|static */ protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator, $count, $boolean) { - $this->mergeWheresToHas($hasQuery, $relation); + $hasQuery->mergeModelDefinedRelationConstraints($relation->getQuery()); - if (is_numeric($count)) { - $count = new Expression($count); + if ($this->shouldRunExistsQuery($operator, $count)) { + $not = ($operator === '<' && $count === 1); + + return $this->addWhereExistsQuery($hasQuery->toBase(), $boolean, $not); } - return $this->where(new Expression('('.$hasQuery->toSql().')'), $operator, $count, $boolean); + return $this->whereCountQuery($hasQuery->toBase(), $operator, $count, $boolean); } /** - * Merge the "wheres" from a relation query to a has query. + * Check if we can run an "exists" query to optimize performance. * - * @param \Illuminate\Database\Eloquent\Builder $hasQuery - * @param \Illuminate\Database\Eloquent\Relations\Relation $relation - * @return void + * @param string $operator + * @param int $count + * @return bool + */ + protected function shouldRunExistsQuery($operator, $count) + { + return ($operator === '>=' || $operator === '<') && $count === 1; + } + + /** + * Add a sub query count clause to the query. + * + * @param \Illuminate\Database\Query\Builder $query + * @param string $operator + * @param int $count + * @param string $boolean + * @return $this */ - protected function mergeWheresToHas(Builder $hasQuery, Relation $relation) + protected function whereCountQuery(QueryBuilder $query, $operator = '>=', $count = 1, $boolean = 'and') { - // Here we have the "has" query and the original relation. We need to copy over any - // where clauses the developer may have put in the relationship function over to - // the has query, and then copy the bindings from the "has" query to the main. - $relationQuery = $relation->getBaseQuery(); + if (is_numeric($count)) { + $count = new Expression($count); + } - $hasQuery = $hasQuery->getModel()->removeGlobalScopes($hasQuery); + $this->query->addBinding($query->getBindings(), 'where'); - $whereBindings = array_get($relationQuery->getRawBindings(), 'where', []); + return $this->where(new Expression('('.$query->toSql().')'), $operator, $count, $boolean); + } - $hasQuery->mergeWheres($relationQuery->wheres, $whereBindings); + /** + * Merge the constraints from a relation query to the current query. + * + * @param \Illuminate\Database\Eloquent\Builder $relation + * @return \Illuminate\Database\Eloquent\Builder|static + */ + public function mergeModelDefinedRelationConstraints(Builder $relation) + { + $removedScopes = $relation->removedScopes(); - $this->query->addBinding($hasQuery->getQuery()->getBindings(), 'where'); + $relationQuery = $relation->getQuery(); + + // Here we have some relation query and the original relation. We need to copy over any + // where clauses that the developer may have put in the relation definition function. + // We need to remove any global scopes that the developer already removed as well. + return $this->withoutGlobalScopes($removedScopes)->mergeWheres( + $relationQuery->wheres, $relationQuery->getBindings() + ); } /** @@ -820,20 +1025,71 @@ public function with($relations) $relations = func_get_args(); } - $eagers = $this->parseRelations($relations); + $eagers = $this->parseWithRelations($relations); $this->eagerLoad = array_merge($this->eagerLoad, $eagers); return $this; } + /** + * Prevent the specified relations from being eager loaded. + * + * @param mixed $relations + * @return $this + */ + public function without($relations) + { + if (is_string($relations)) { + $relations = func_get_args(); + } + + $this->eagerLoad = array_diff_key($this->eagerLoad, array_flip($relations)); + + return $this; + } + + /** + * Add subselect queries to count the relations. + * + * @param mixed $relations + * @return $this + */ + public function withCount($relations) + { + if (is_null($this->query->columns)) { + $this->query->select(['*']); + } + + $relations = is_array($relations) ? $relations : func_get_args(); + + foreach ($this->parseWithRelations($relations) as $name => $constraints) { + // Here we will get the relationship count query and prepare to add it to the main query + // as a sub-select. First, we'll get the "has" query and use that to get the relation + // count query. We will normalize the relation name then append _count as the name. + $relation = $this->getHasRelationQuery($name); + + $query = $relation->getRelationCountQuery( + $relation->getRelated()->newQuery(), $this + ); + + $query->callScope($constraints); + + $query->mergeModelDefinedRelationConstraints($relation->getQuery()); + + $this->selectSub($query->toBase(), snake_case($name).'_count'); + } + + return $this; + } + /** * Parse a list of relations into individuals. * * @param array $relations * @return array */ - protected function parseRelations(array $relations) + protected function parseWithRelations(array $relations) { $results = []; @@ -852,7 +1108,7 @@ protected function parseRelations(array $relations) // We need to separate out any nested includes. Which allows the developers // to load deep relationships using "dots" without stating each level of // the relationship with its own key in the array of eager load names. - $results = $this->parseNested($name, $results); + $results = $this->parseNestedWith($name, $results); $results[$name] = $constraints; } @@ -867,7 +1123,7 @@ protected function parseRelations(array $relations) * @param array $results * @return array */ - protected function parseNested($name, $results) + protected function parseNestedWith($name, $results) { $progress = []; @@ -888,29 +1144,178 @@ protected function parseNested($name, $results) } /** - * Call the given model scope on the underlying model. + * Add the given scopes to the current builder instance. * - * @param string $scope - * @param array $parameters - * @return \Illuminate\Database\Query\Builder + * @param array $scopes + * @return mixed */ - protected function callScope($scope, $parameters) + public function scopes(array $scopes) + { + $builder = $this; + + foreach ($scopes as $scope => $parameters) { + if (is_int($scope)) { + list($scope, $parameters) = [$parameters, []]; + } + + $builder = $builder->callScope( + [$this->model, 'scope'.ucfirst($scope)], (array) $parameters + ); + } + + return $builder; + } + + /** + * Apply the given scope on the current builder instance. + * + * @param callable $scope + * @param array $parameters + * @return mixed + */ + protected function callScope(callable $scope, $parameters = []) { array_unshift($parameters, $this); - return call_user_func_array([$this->model, $scope], $parameters) ?: $this; + $query = $this->getQuery(); + + // We will keep track of how many wheres are on the query before running the + // scope so that we can properly group the added scope constraints in the + // query as their own isolated nested where statement and avoid issues. + $originalWhereCount = count($query->wheres); + + $result = call_user_func_array($scope, $parameters) ?: $this; + + if ($this->shouldNestWheresForScope($query, $originalWhereCount)) { + $this->nestWheresForScope($query, $originalWhereCount); + } + + return $result; + } + + /** + * Apply the scopes to the Eloquent builder instance and return it. + * + * @return \Illuminate\Database\Eloquent\Builder|static + */ + public function applyScopes() + { + if (! $this->scopes) { + return $this; + } + + $builder = clone $this; + + foreach ($this->scopes as $scope) { + $builder->callScope(function (Builder $builder) use ($scope) { + if ($scope instanceof Closure) { + $scope($builder); + } elseif ($scope instanceof Scope) { + $scope->apply($builder, $this->getModel()); + } + }); + } + + return $builder; + } + + /** + * Determine if the scope added after the given offset should be nested. + * + * @param \Illuminate\Database\Query\Builder $query + * @param int $originalWhereCount + * @return bool + */ + protected function shouldNestWheresForScope(QueryBuilder $query, $originalWhereCount) + { + return count($query->wheres) > $originalWhereCount; + } + + /** + * Nest where conditions by slicing them at the given where count. + * + * @param \Illuminate\Database\Query\Builder $query + * @param int $originalWhereCount + * @return void + */ + protected function nestWheresForScope(QueryBuilder $query, $originalWhereCount) + { + // Here, we totally remove all of the where clauses since we are going to + // rebuild them as nested queries by slicing the groups of wheres into + // their own sections. This is to prevent any confusing logic order. + $allWheres = $query->wheres; + + $query->wheres = []; + + $this->addNestedWhereSlice( + $query, $allWheres, 0, $originalWhereCount + ); + + $this->addNestedWhereSlice( + $query, $allWheres, $originalWhereCount + ); + } + + /** + * Slice where conditions at the given offset and add them to the query as a nested condition. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $wheres + * @param int $offset + * @param int $length + * @return void + */ + protected function addNestedWhereSlice(QueryBuilder $query, $wheres, $offset, $length = null) + { + $whereSlice = array_slice($wheres, $offset, $length); + + $whereBooleans = collect($whereSlice)->pluck('boolean'); + + // Here we'll check if the given subset of where clauses contains any "or" + // booleans and in this case create a nested where expression. That way + // we don't add any unnecessary nesting thus keeping the query clean. + if ($whereBooleans->contains('or')) { + $query->wheres[] = $this->nestWhereSlice($whereSlice); + } else { + $query->wheres = array_merge($query->wheres, $whereSlice); + } + } + + /** + * Create a where array with nested where conditions. + * + * @param array $whereSlice + * @return array + */ + protected function nestWhereSlice($whereSlice) + { + $whereGroup = $this->getQuery()->forNestedWhere(); + + $whereGroup->wheres = $whereSlice; + + return ['type' => 'Nested', 'query' => $whereGroup, 'boolean' => 'and']; } /** * Get the underlying query builder instance. * - * @return \Illuminate\Database\Query\Builder|static + * @return \Illuminate\Database\Query\Builder */ public function getQuery() { return $this->query; } + /** + * Get a base query builder instance. + * + * @return \Illuminate\Database\Query\Builder + */ + public function toBase() + { + return $this->applyScopes()->getQuery(); + } + /** * Set the underlying query builder instance. * @@ -1008,13 +1413,19 @@ public function __call($method, $parameters) array_unshift($parameters, $this); return call_user_func_array($this->macros[$method], $parameters); - } elseif (method_exists($this->model, $scope = 'scope'.ucfirst($method))) { - return $this->callScope($scope, $parameters); } - $result = call_user_func_array([$this->query, $method], $parameters); + if (method_exists($this->model, $scope = 'scope'.ucfirst($method))) { + return $this->callScope([$this->model, $scope], $parameters); + } + + if (in_array($method, $this->passthru)) { + return call_user_func_array([$this->toBase(), $method], $parameters); + } + + call_user_func_array([$this->query, $method], $parameters); - return in_array($method, $this->passthru) ? $result : $this; + return $this; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php old mode 100644 new mode 100755 index 19a449e..e2e2228 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php @@ -2,10 +2,12 @@ namespace Illuminate\Database\Eloquent; +use LogicException; use Illuminate\Support\Arr; +use Illuminate\Contracts\Queue\QueueableCollection; use Illuminate\Support\Collection as BaseCollection; -class Collection extends BaseCollection +class Collection extends BaseCollection implements QueueableCollection { /** * Find a model in the collection by key. @@ -83,19 +85,6 @@ public function contains($key, $value = null) }); } - /** - * Fetch a nested element of the collection. - * - * @param string $key - * @return static - * - * @deprecated since version 5.1. Use pluck instead. - */ - public function fetch($key) - { - return new static(Arr::fetch($this->toArray(), $key)); - } - /** * Get the array of primary keys. * @@ -208,25 +197,49 @@ public function except($keys) return new static(array_values($dictionary)); } + /** + * Make the given, typically visible, attributes hidden across the entire collection. + * + * @param array|string $attributes + * @return $this + */ + public function makeHidden($attributes) + { + return $this->each(function ($model) use ($attributes) { + $model->addHidden($attributes); + }); + } + /** * Make the given, typically hidden, attributes visible across the entire collection. * * @param array|string $attributes * @return $this */ - public function withHidden($attributes) + public function makeVisible($attributes) { - $this->each(function ($model) use ($attributes) { - $model->withHidden($attributes); + return $this->each(function ($model) use ($attributes) { + $model->makeVisible($attributes); }); + } - return $this; + /** + * Make the given, typically hidden, attributes visible across the entire collection. + * + * @param array|string $attributes + * @return $this + * + * @deprecated since version 5.2. Use the "makeVisible" method directly. + */ + public function withHidden($attributes) + { + return $this->makeVisible($attributes); } /** * Get a dictionary keyed by primary keys. * - * @param \ArrayAccess|array $items + * @param \ArrayAccess|array|null $items * @return array */ public function getDictionary($items = null) @@ -242,6 +255,106 @@ public function getDictionary($items = null) return $dictionary; } + /** + * The following methods are intercepted to always return base collections. + */ + + /** + * Get an array with the values of a given key. + * + * @param string $value + * @param string|null $key + * @return \Illuminate\Support\Collection + */ + public function pluck($value, $key = null) + { + return $this->toBase()->pluck($value, $key); + } + + /** + * Get the keys of the collection items. + * + * @return \Illuminate\Support\Collection + */ + public function keys() + { + return $this->toBase()->keys(); + } + + /** + * Zip the collection together with one or more arrays. + * + * @param mixed ...$items + * @return \Illuminate\Support\Collection + */ + public function zip($items) + { + return call_user_func_array([$this->toBase(), 'zip'], func_get_args()); + } + + /** + * Collapse the collection of items into a single array. + * + * @return \Illuminate\Support\Collection + */ + public function collapse() + { + return $this->toBase()->collapse(); + } + + /** + * Get a flattened array of the items in the collection. + * + * @param int $depth + * @return \Illuminate\Support\Collection + */ + public function flatten($depth = INF) + { + return $this->toBase()->flatten($depth); + } + + /** + * Flip the items in the collection. + * + * @return \Illuminate\Support\Collection + */ + public function flip() + { + return $this->toBase()->flip(); + } + + /** + * Get the type of the entities being queued. + * + * @return string|null + */ + public function getQueueableClass() + { + if ($this->count() === 0) { + return; + } + + $class = get_class($this->first()); + + $this->each(function ($model) use ($class) { + if (get_class($model) !== $class) { + throw new LogicException('Queueing collections with multiple model types is not supported.'); + } + }); + + return $class; + } + + /** + * Get the identifiers for all of the entities. + * + * @return array + */ + public function getQueueableIds() + { + return $this->modelKeys(); + } + /** * Get a base Support collection instance from this collection. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php index 89d274e..3fdb4b0 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent; +use Closure; use Faker\Generator as Faker; use InvalidArgumentException; @@ -119,6 +120,8 @@ public function make(array $attributes = []) * * @param array $attributes * @return \Illuminate\Database\Eloquent\Model + * + * @throws \InvalidArgumentException */ protected function makeInstance(array $attributes = []) { @@ -127,9 +130,32 @@ protected function makeInstance(array $attributes = []) throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."); } - $definition = call_user_func($this->definitions[$this->class][$this->name], $this->faker, $attributes); + $definition = call_user_func( + $this->definitions[$this->class][$this->name], + $this->faker, $attributes + ); + + $evaluated = $this->callClosureAttributes( + array_merge($definition, $attributes) + ); - return new $this->class(array_merge($definition, $attributes)); + return new $this->class($evaluated); }); } + + /** + * Evaluate any Closure attributes on the attribute array. + * + * @param array $attributes + * @return array + */ + protected function callClosureAttributes(array $attributes) + { + foreach ($attributes as &$attribute) { + $attribute = $attribute instanceof Closure + ? $attribute($attributes) : $attribute; + } + + return $attributes; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MassAssignmentException.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/MassAssignmentException.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php old mode 100644 new mode 100755 index 253a1d4..bc15da6 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php @@ -2,14 +2,17 @@ namespace Illuminate\Database\Eloquent; +use Closure; use DateTime; use Exception; use ArrayAccess; use Carbon\Carbon; use LogicException; use JsonSerializable; +use DateTimeInterface; use Illuminate\Support\Arr; use Illuminate\Support\Str; +use InvalidArgumentException; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Support\Arrayable; @@ -19,11 +22,11 @@ use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\MorphTo; -use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\Relation; +use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Support\Collection as BaseCollection; -use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\Eloquent\Relations\MorphToMany; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -53,6 +56,13 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab */ protected $primaryKey = 'id'; + /** + * The "type" of the auto-incrementing ID. + * + * @var string + */ + protected $keyType = 'int'; + /** * The number of models to return for pagination. * @@ -285,10 +295,8 @@ public function __construct(array $attributes = []) */ protected function bootIfNotBooted() { - $class = get_class($this); - - if (! isset(static::$booted[$class])) { - static::$booted[$class] = true; + if (! isset(static::$booted[static::class])) { + static::$booted[static::class] = true; $this->fireModelEvent('booting', false); @@ -315,9 +323,11 @@ protected static function boot() */ protected static function bootTraits() { - foreach (class_uses_recursive(get_called_class()) as $trait) { - if (method_exists(get_called_class(), $method = 'boot'.class_basename($trait))) { - forward_static_call([get_called_class(), $method]); + $class = static::class; + + foreach (class_uses_recursive($class) as $trait) { + if (method_exists($class, $method = 'boot'.class_basename($trait))) { + forward_static_call([$class, $method]); } } } @@ -330,23 +340,39 @@ protected static function bootTraits() public static function clearBootedModels() { static::$booted = []; + static::$globalScopes = []; } /** * Register a new global scope on the model. * - * @param \Illuminate\Database\Eloquent\ScopeInterface $scope - * @return void + * @param \Illuminate\Database\Eloquent\Scope|\Closure|string $scope + * @param \Closure|null $implementation + * @return mixed + * + * @throws \InvalidArgumentException */ - public static function addGlobalScope(ScopeInterface $scope) + public static function addGlobalScope($scope, Closure $implementation = null) { - static::$globalScopes[get_called_class()][get_class($scope)] = $scope; + if (is_string($scope) && $implementation !== null) { + return static::$globalScopes[static::class][$scope] = $implementation; + } + + if ($scope instanceof Closure) { + return static::$globalScopes[static::class][spl_object_hash($scope)] = $scope; + } + + if ($scope instanceof Scope) { + return static::$globalScopes[static::class][get_class($scope)] = $scope; + } + + throw new InvalidArgumentException('Global scope must be an instance of Closure or Scope.'); } /** * Determine if a model has a global scope. * - * @param \Illuminate\Database\Eloquent\ScopeInterface $scope + * @param \Illuminate\Database\Eloquent\Scope|string $scope * @return bool */ public static function hasGlobalScope($scope) @@ -357,14 +383,16 @@ public static function hasGlobalScope($scope) /** * Get a global scope registered with the model. * - * @param \Illuminate\Database\Eloquent\ScopeInterface $scope - * @return \Illuminate\Database\Eloquent\ScopeInterface|null + * @param \Illuminate\Database\Eloquent\Scope|string $scope + * @return \Illuminate\Database\Eloquent\Scope|\Closure|null */ public static function getGlobalScope($scope) { - return Arr::first(static::$globalScopes[get_called_class()], function ($key, $value) use ($scope) { - return $scope instanceof $value; - }); + if (! is_string($scope)) { + $scope = get_class($scope); + } + + return Arr::get(static::$globalScopes, static::class.'.'.$scope); } /** @@ -374,7 +402,7 @@ public static function getGlobalScope($scope) */ public function getGlobalScopes() { - return Arr::get(static::$globalScopes, get_class($this), []); + return Arr::get(static::$globalScopes, static::class, []); } /** @@ -454,8 +482,8 @@ public function forceFill(array $attributes) */ protected function fillableFromArray(array $attributes) { - if (count($this->fillable) > 0 && ! static::$unguarded) { - return array_intersect_key($attributes, array_flip($this->fillable)); + if (count($this->getFillable()) > 0 && ! static::$unguarded) { + return array_intersect_key($attributes, array_flip($this->getFillable())); } return $attributes; @@ -493,7 +521,7 @@ public function newFromBuilder($attributes = [], $connection = null) $model->setRawAttributes((array) $attributes, true); - $model->setConnection($connection ?: $this->connection); + $model->setConnection($connection ?: $this->getConnectionName()); return $model; } @@ -624,15 +652,19 @@ public static function all($columns = ['*']) /** * Reload a fresh model instance from the database. * - * @param array $with - * @return static|null + * @param array|string $with + * @return $this|null */ - public function fresh(array $with = []) + public function fresh($with = []) { if (! $this->exists) { return; } + if (is_string($with)) { + $with = func_get_args(); + } + $key = $this->getKeyName(); return static::with($with)->where($key, $this->getKey())->first(); @@ -1241,7 +1273,7 @@ public static function flushEventListeners() $instance = new static; foreach ($instance->getObservableEvents() as $event) { - static::$dispatcher->forget("eloquent.{$event}: ".get_called_class()); + static::$dispatcher->forget("eloquent.{$event}: ".static::class); } } @@ -1256,7 +1288,7 @@ public static function flushEventListeners() protected static function registerModelEvent($event, $callback, $priority = 0) { if (isset(static::$dispatcher)) { - $name = get_called_class(); + $name = static::class; static::$dispatcher->listen("eloquent.{$event}: {$name}", $callback, $priority); } @@ -1323,11 +1355,12 @@ public function removeObservableEvents($observables) * * @param string $column * @param int $amount + * @param array $extra * @return int */ - protected function increment($column, $amount = 1) + protected function increment($column, $amount = 1, array $extra = []) { - return $this->incrementOrDecrement($column, $amount, 'increment'); + return $this->incrementOrDecrement($column, $amount, $extra, 'increment'); } /** @@ -1335,11 +1368,12 @@ protected function increment($column, $amount = 1) * * @param string $column * @param int $amount + * @param array $extra * @return int */ - protected function decrement($column, $amount = 1) + protected function decrement($column, $amount = 1, array $extra = []) { - return $this->incrementOrDecrement($column, $amount, 'decrement'); + return $this->incrementOrDecrement($column, $amount, $extra, 'decrement'); } /** @@ -1347,20 +1381,21 @@ protected function decrement($column, $amount = 1) * * @param string $column * @param int $amount + * @param array $extra * @param string $method * @return int */ - protected function incrementOrDecrement($column, $amount, $method) + protected function incrementOrDecrement($column, $amount, $extra, $method) { $query = $this->newQuery(); if (! $this->exists) { - return $query->{$method}($column, $amount); + return $query->{$method}($column, $amount, $extra); } $this->incrementOrDecrementAttributeValue($column, $amount, $method); - return $query->where($this->getKeyName(), $this->getKey())->{$method}($column, $amount); + return $query->where($this->getKeyName(), $this->getKey())->{$method}($column, $amount, $extra); } /** @@ -1382,15 +1417,16 @@ protected function incrementOrDecrementAttributeValue($column, $amount, $method) * Update the model in the database. * * @param array $attributes + * @param array $options * @return bool|int */ - public function update(array $attributes = []) + public function update(array $attributes = [], array $options = []) { if (! $this->exists) { return false; } - return $this->fill($attributes)->save(); + return $this->fill($attributes)->save($options); } /** @@ -1557,7 +1593,7 @@ protected function performInsert(Builder $query, array $options = []) // table from the database. Not all tables have to be incrementing though. $attributes = $this->attributes; - if ($this->incrementing) { + if ($this->getIncrementing()) { $this->insertAndSetId($query, $attributes); } @@ -1643,7 +1679,7 @@ protected function fireModelEvent($event, $halt = true) // We will append the names of the class to the event to distinguish it from // other model events that are fired, allowing us to listen on each model // event set individually instead of catching event for all the models. - $event = "eloquent.{$event}: ".get_class($this); + $event = "eloquent.{$event}: ".static::class; $method = $halt ? 'until' : 'fire'; @@ -1786,20 +1822,24 @@ public function newQuery() { $builder = $this->newQueryWithoutScopes(); - return $this->applyGlobalScopes($builder); + foreach ($this->getGlobalScopes() as $identifier => $scope) { + $builder->withGlobalScope($identifier, $scope); + } + + return $builder; } /** * Get a new query instance without a given scope. * - * @param \Illuminate\Database\Eloquent\ScopeInterface $scope + * @param \Illuminate\Database\Eloquent\Scope|string $scope * @return \Illuminate\Database\Eloquent\Builder */ public function newQueryWithoutScope($scope) { - $this->getGlobalScope($scope)->remove($builder = $this->newQuery(), $this); + $builder = $this->newQuery(); - return $builder; + return $builder->withoutGlobalScope($scope); } /** @@ -1819,36 +1859,6 @@ public function newQueryWithoutScopes() return $builder->setModel($this)->with($this->with); } - /** - * Apply all of the global scopes to an Eloquent builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return \Illuminate\Database\Eloquent\Builder - */ - public function applyGlobalScopes($builder) - { - foreach ($this->getGlobalScopes() as $scope) { - $scope->apply($builder, $this); - } - - return $builder; - } - - /** - * Remove all of the global scopes from an Eloquent builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return \Illuminate\Database\Eloquent\Builder - */ - public function removeGlobalScopes($builder) - { - foreach ($this->getGlobalScopes() as $scope) { - $scope->remove($builder, $this); - } - - return $builder; - } - /** * Create a new Eloquent query builder for the model. * @@ -2035,7 +2045,7 @@ public function getMorphClass() { $morphMap = Relation::morphMap(); - $class = get_class($this); + $class = static::class; if (! empty($morphMap) && in_array($class, $morphMap)) { return array_search($class, $morphMap, true); @@ -2119,13 +2129,47 @@ public function addHidden($attributes = null) * @param array|string $attributes * @return $this */ - public function withHidden($attributes) + public function makeVisible($attributes) { $this->hidden = array_diff($this->hidden, (array) $attributes); + if (! empty($this->visible)) { + $this->addVisible($attributes); + } + + return $this; + } + + /** + * Make the given, typically visible, attributes hidden. + * + * @param array|string $attributes + * @return $this + */ + public function makeHidden($attributes) + { + $attributes = (array) $attributes; + + $this->visible = array_diff($this->visible, $attributes); + + $this->hidden = array_unique(array_merge($this->hidden, $attributes)); + return $this; } + /** + * Make the given, typically hidden, attributes visible. + * + * @param array|string $attributes + * @return $this + * + * @deprecated since version 5.2. Use the "makeVisible" method directly. + */ + public function withHidden($attributes) + { + return $this->makeVisible($attributes); + } + /** * Get the visible attributes for the model. * @@ -2288,7 +2332,7 @@ public function isFillable($key) // If the key is in the "fillable" array, we can of course assume that it's // a fillable attribute. Otherwise, we will check the guarded array when // we need to determine if the attribute is black-listed on the model. - if (in_array($key, $this->fillable)) { + if (in_array($key, $this->getFillable())) { return true; } @@ -2296,7 +2340,7 @@ public function isFillable($key) return false; } - return empty($this->fillable) && ! Str::startsWith($key, '_'); + return empty($this->getFillable()) && ! Str::startsWith($key, '_'); } /** @@ -2307,7 +2351,7 @@ public function isFillable($key) */ public function isGuarded($key) { - return in_array($key, $this->guarded) || $this->guarded == ['*']; + return in_array($key, $this->getGuarded()) || $this->getGuarded() == ['*']; } /** @@ -2317,7 +2361,7 @@ public function isGuarded($key) */ public function totallyGuarded() { - return count($this->fillable) == 0 && $this->guarded == ['*']; + return count($this->getFillable()) == 0 && $this->getGuarded() == ['*']; } /** @@ -2454,7 +2498,7 @@ public function attributesToArray() // Next we will handle any casts that have been setup for this model and cast // the values to their appropriate type. If the attribute has a mutator we // will not perform the cast on those attributes to avoid any confusion. - foreach ($this->casts as $key => $value) { + foreach ($this->getCasts() as $key => $value) { if (! array_key_exists($key, $attributes) || in_array($key, $mutatedAttributes)) { continue; @@ -2463,6 +2507,10 @@ public function attributesToArray() $attributes[$key] = $this->castAttribute( $key, $attributes[$key] ); + + if ($attributes[$key] && ($value === 'date' || $value === 'datetime')) { + $attributes[$key] = $this->serializeDate($attributes[$key]); + } } // Here we will grab all of the appended, calculated attributes to this model @@ -2564,10 +2612,14 @@ protected function getArrayableRelations() protected function getArrayableItems(array $values) { if (count($this->getVisible()) > 0) { - return array_intersect_key($values, array_flip($this->getVisible())); + $values = array_intersect_key($values, array_flip($this->getVisible())); + } + + if (count($this->getHidden()) > 0) { + $values = array_diff_key($values, array_flip($this->getHidden())); } - return array_diff_key($values, array_flip($this->getHidden())); + return $values; } /** @@ -2606,16 +2658,14 @@ public function getAttributeValue($key) // an appropriate native PHP type dependant upon the associated value // given with the key in the pair. Dayle made this comment line up. if ($this->hasCast($key)) { - $value = $this->castAttribute($key, $value); + return $this->castAttribute($key, $value); } // If the attribute is listed as a date, we will convert it to a DateTime // instance on retrieval, which makes it quite convenient to work with // date fields without having to create a mutator for each property. - elseif (in_array($key, $this->getDates())) { - if (! is_null($value)) { - return $this->asDateTime($value); - } + if (in_array($key, $this->getDates()) && ! is_null($value)) { + return $this->asDateTime($value); } return $value; @@ -2674,7 +2724,9 @@ protected function getRelationshipFromMethod($method) .'Illuminate\Database\Eloquent\Relations\Relation'); } - return $this->relations[$method] = $relations->getResults(); + $this->setRelation($method, $results = $relations->getResults()); + + return $results; } /** @@ -2718,11 +2770,32 @@ protected function mutateAttributeForArray($key, $value) * Determine whether an attribute should be cast to a native type. * * @param string $key + * @param array|string|null $types * @return bool */ - protected function hasCast($key) + public function hasCast($key, $types = null) { - return array_key_exists($key, $this->casts); + if (array_key_exists($key, $this->getCasts())) { + return $types ? in_array($this->getCastType($key), (array) $types, true) : true; + } + + return false; + } + + /** + * Get the casts array. + * + * @return array + */ + public function getCasts() + { + if ($this->getIncrementing()) { + return array_merge([ + $this->getKeyName() => $this->keyType, + ], $this->casts); + } + + return $this->casts; } /** @@ -2733,8 +2806,7 @@ protected function hasCast($key) */ protected function isDateCastable($key) { - return $this->hasCast($key) && - in_array($this->getCastType($key), ['date', 'datetime'], true); + return $this->hasCast($key, ['date', 'datetime']); } /** @@ -2745,8 +2817,7 @@ protected function isDateCastable($key) */ protected function isJsonCastable($key) { - return $this->hasCast($key) && - in_array($this->getCastType($key), ['array', 'json', 'object', 'collection'], true); + return $this->hasCast($key, ['array', 'json', 'object', 'collection']); } /** @@ -2757,7 +2828,7 @@ protected function isJsonCastable($key) */ protected function getCastType($key) { - return trim(strtolower($this->casts[$key])); + return trim(strtolower($this->getCasts()[$key])); } /** @@ -2796,6 +2867,8 @@ protected function castAttribute($key, $value) case 'date': case 'datetime': return $this->asDateTime($value); + case 'timestamp': + return $this->asTimeStamp($value); default: return $value; } @@ -2882,17 +2955,19 @@ public function fromDateTime($value) protected function asDateTime($value) { // If this value is already a Carbon instance, we shall just return it as is. - // This prevents us having to reinstantiate a Carbon instance when we know + // This prevents us having to re-instantiate a Carbon instance when we know // it already is one, which wouldn't be fulfilled by the DateTime check. if ($value instanceof Carbon) { return $value; } - // If the value is already a DateTime instance, we will just skip the rest of - // these checks since they will be a waste of time, and hinder performance - // when checking the field. We will just return the DateTime right away. - if ($value instanceof DateTime) { - return Carbon::instance($value); + // If the value is already a DateTime instance, we will just skip the rest of + // these checks since they will be a waste of time, and hinder performance + // when checking the field. We will just return the DateTime right away. + if ($value instanceof DateTimeInterface) { + return new Carbon( + $value->format('Y-m-d H:i:s.u'), $value->getTimeZone() + ); } // If this value is an integer, we will assume it is a UNIX timestamp's value @@ -2905,7 +2980,7 @@ protected function asDateTime($value) // If the value is in simply year, month, day format, we will instantiate the // Carbon instances from that format. Again, this provides for simple date // fields on the database, while still supporting Carbonized conversion. - if (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $value)) { + if (preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value)) { return Carbon::createFromFormat('Y-m-d', $value)->startOfDay(); } @@ -2915,6 +2990,17 @@ protected function asDateTime($value) return Carbon::createFromFormat($this->getDateFormat(), $value); } + /** + * Return a timestamp as unix timestamp. + * + * @param mixed $value + * @return int + */ + protected function asTimeStamp($value) + { + return $this->asDateTime($value)->getTimestamp(); + } + /** * Prepare a date for array / JSON serialization. * @@ -2980,15 +3066,19 @@ public function fromJson($value, $asObject = false) */ public function replicate(array $except = null) { - $except = $except ?: [ + $defaults = [ $this->getKeyName(), $this->getCreatedAtColumn(), $this->getUpdatedAtColumn(), ]; + $except = $except ? array_unique(array_merge($except, $defaults)) : $defaults; + $attributes = Arr::except($this->attributes, $except); - with($instance = new static)->setRawAttributes($attributes); + $instance = new static; + + $instance->setRawAttributes($attributes); return $instance->setRelations($this->relations); } @@ -3026,7 +3116,7 @@ public function setRawAttributes(array $attributes, $sync = false) * * @param string|null $key * @param mixed $default - * @return array + * @return mixed|array */ public function getOriginal($key = null, $default = null) { @@ -3187,7 +3277,7 @@ public function setRelations(array $relations) */ public function getConnection() { - return static::resolveConnection($this->connection); + return static::resolveConnection($this->getConnectionName()); } /** @@ -3293,7 +3383,7 @@ public static function unsetEventDispatcher() */ public function getMutatedAttributes() { - $class = get_class($this); + $class = static::class; if (! isset(static::$mutatorCache[$class])) { static::cacheMutatedAttributes($class); @@ -3404,15 +3494,7 @@ public function offsetUnset($offset) */ public function __isset($key) { - if (isset($this->attributes[$key]) || isset($this->relations[$key])) { - return true; - } - - if (method_exists($this, $key) && $this->$key && isset($this->relations[$key])) { - return true; - } - - return $this->hasGetMutator($key) && ! is_null($this->getAttributeValue($key)); + return ! is_null($this->getAttribute($key)); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/ModelNotFoundException.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/ModelNotFoundException.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php index 0e630c7..22fccf2 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/QueueEntityResolver.php @@ -13,6 +13,8 @@ class QueueEntityResolver implements EntityResolverContract * @param string $type * @param mixed $id * @return mixed + * + * @throws \Illuminate\Contracts\Queue\EntityNotFoundException */ public function resolve($type, $id) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php old mode 100644 new mode 100755 index 968749f..a3394c1 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php @@ -30,6 +30,13 @@ class BelongsTo extends Relation */ protected $relation; + /** + * The count of self joins. + * + * @var int + */ + protected static $selfJoinCount = 0; + /** * Create a new belongs to relationship instance. * @@ -77,19 +84,20 @@ public function addConstraints() } /** - * Add the constraints for a relationship count query. + * Add the constraints for a relationship query. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQuery(Builder $query, Builder $parent) + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { if ($parent->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationCountQueryForSelfRelation($query, $parent); + return $this->getRelationQueryForSelfRelation($query, $parent, $columns); } - $query->select(new Expression('count(*)')); + $query->select($columns); $otherKey = $this->wrap($query->getModel()->getTable().'.'.$this->otherKey); @@ -97,15 +105,16 @@ public function getRelationCountQuery(Builder $query, Builder $parent) } /** - * Add the constraints for a relationship count query on the same table. + * Add the constraints for a relationship query on the same table. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQueryForSelfRelation(Builder $query, Builder $parent) + public function getRelationQueryForSelfRelation(Builder $query, Builder $parent, $columns = ['*']) { - $query->select(new Expression('count(*)')); + $query->select($columns); $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); @@ -123,7 +132,7 @@ public function getRelationCountQueryForSelfRelation(Builder $query, Builder $pa */ public function getRelationCountHash() { - return 'self_'.md5(microtime(true)); + return 'laravel_reserved_'.static::$selfJoinCount++; } /** @@ -161,11 +170,11 @@ protected function getEagerModelKeys(array $models) } } - // If there are no keys that were not null we will just return an array with 0 in - // it so the query doesn't fail, but will not return any results, which should - // be what this developer is expecting in a case where this happens to them. - if (count($keys) == 0) { - return [0]; + // If there are no keys that were not null we will just return an array with either + // null or 0 in (depending on if incrementing keys are in use) so the query wont + // fail plus returns zero results, which should be what the developer expects. + if (count($keys) === 0) { + return [$this->related->getIncrementing() ? 0 : null]; } return array_values(array_unique($keys)); diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php old mode 100644 new mode 100755 index 809e1e7..51b3c94 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -6,7 +6,6 @@ use Illuminate\Support\Str; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Query\Expression; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\ModelNotFoundException; @@ -48,12 +47,19 @@ class BelongsToMany extends Relation protected $pivotColumns = []; /** - * Any pivot table restrictions. + * Any pivot table restrictions for where clauses. * * @var array */ protected $pivotWheres = []; + /** + * Any pivot table restrictions for whereIn clauses. + * + * @var array + */ + protected $pivotWhereIns = []; + /** * The custom pivot table column for the created_at timestamp. * @@ -68,6 +74,13 @@ class BelongsToMany extends Relation */ protected $pivotUpdatedAt; + /** + * The count of self joins. + * + * @var int + */ + protected static $selfJoinCount = 0; + /** * Create a new belongs to many relationship instance. * @@ -116,7 +129,23 @@ public function wherePivot($column, $operator = null, $value = null, $boolean = } /** - * Set an or where clause for a pivot table column. + * Set a "where in" clause for a pivot table column. + * + * @param string $column + * @param mixed $values + * @param string $boolean + * @param bool $not + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + */ + public function wherePivotIn($column, $values, $boolean = 'and', $not = false) + { + $this->pivotWhereIns[] = func_get_args(); + + return $this->whereIn($this->table.'.'.$column, $values, $boolean, $not); + } + + /** + * Set an "or where" clause for a pivot table column. * * @param string $column * @param string $operator @@ -128,6 +157,18 @@ public function orWherePivot($column, $operator = null, $value = null) return $this->wherePivot($column, $operator, $value, 'or'); } + /** + * Set an "or where in" clause for a pivot table column. + * + * @param string $column + * @param mixed $values + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + */ + public function orWherePivotIn($column, $values) + { + return $this->wherePivotIn($column, $values, 'or'); + } + /** * Execute the query and get the first result. * @@ -155,7 +196,7 @@ public function firstOrFail($columns = ['*']) return $model; } - throw new ModelNotFoundException; + throw (new ModelNotFoundException)->setModel(get_class($this->parent)); } /** @@ -173,7 +214,9 @@ public function get($columns = ['*']) $select = $this->getSelectColumns($columns); - $models = $this->query->addSelect($select)->getModels(); + $builder = $this->query->applyScopes(); + + $models = $builder->addSelect($select)->getModels(); $this->hydratePivotRelation($models); @@ -181,7 +224,7 @@ public function get($columns = ['*']) // have been specified as needing to be eager loaded. This will solve the // n + 1 query problem for the developer and also increase performance. if (count($models) > 0) { - $models = $this->query->eagerLoadRelations($models); + $models = $builder->eagerLoadRelations($models); } return $this->related->newCollection($models); @@ -301,33 +344,35 @@ public function addConstraints() } /** - * Add the constraints for a relationship count query. + * Add the constraints for a relationship query. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQuery(Builder $query, Builder $parent) + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { if ($parent->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationCountQueryForSelfJoin($query, $parent); + return $this->getRelationQueryForSelfJoin($query, $parent, $columns); } $this->setJoin($query); - return parent::getRelationCountQuery($query, $parent); + return parent::getRelationQuery($query, $parent, $columns); } /** - * Add the constraints for a relationship count query on the same table. + * Add the constraints for a relationship query on the same table. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQueryForSelfJoin(Builder $query, Builder $parent) + public function getRelationQueryForSelfJoin(Builder $query, Builder $parent, $columns = ['*']) { - $query->select(new Expression('count(*)')); + $query->select($columns); $query->from($this->related->getTable().' as '.$hash = $this->getRelationCountHash()); @@ -335,7 +380,7 @@ public function getRelationCountQueryForSelfJoin(Builder $query, Builder $parent $this->setJoin($query); - return parent::getRelationCountQuery($query, $parent); + return parent::getRelationQuery($query, $parent, $columns); } /** @@ -345,7 +390,7 @@ public function getRelationCountQueryForSelfJoin(Builder $query, Builder $parent */ public function getRelationCountHash() { - return 'self_'.md5(microtime(true)); + return 'laravel_reserved_'.static::$selfJoinCount++; } /** @@ -540,7 +585,7 @@ public function getRelatedIds() $fullKey = $related->getQualifiedKeyName(); - return $this->getQuery()->select($fullKey)->lists($related->getKeyName()); + return $this->getQuery()->select($fullKey)->pluck($related->getKeyName()); } /** @@ -750,6 +795,17 @@ public function createMany(array $records, array $joinings = []) return $instances; } + /** + * Sync the intermediate tables with a list of IDs without detaching. + * + * @param \Illuminate\Database\Eloquent\Collection|array $ids + * @return array + */ + public function syncWithoutDetaching($ids) + { + return $this->sync($ids, false); + } + /** * Sync the intermediate tables with a list of IDs or collection of models. * @@ -770,7 +826,7 @@ public function sync($ids, $detaching = true) // First we need to attach any of the associated models that are not currently // in this joining table. We'll spin through the given IDs, checking to see // if they exist in the array of current ones, and if not we will insert. - $current = $this->newPivotQuery()->lists($this->otherKey); + $current = $this->newPivotQuery()->pluck($this->otherKey); $records = $this->formatSyncList($ids); @@ -778,7 +834,7 @@ public function sync($ids, $detaching = true) // Next, we will take the differences of the currents and given IDs and detach // all of the entities that exist in the "current" array but are not in the - // the array of the IDs given to the method which will complete the sync. + // array of the new IDs given to the method which will complete the sync. if ($detaching && count($detach) > 0) { $this->detach($detach); @@ -893,6 +949,10 @@ public function attach($id, array $attributes = [], $touch = true) $id = $id->getKey(); } + if ($id instanceof Collection) { + $id = $id->modelKeys(); + } + $query = $this->newPivotStatement(); $query->insert($this->createAttachRecords((array) $id, $attributes)); @@ -1012,14 +1072,18 @@ protected function setTimestampsOnAttach(array $record, $exists = false) /** * Detach models from the relationship. * - * @param int|array $ids + * @param mixed $ids * @param bool $touch * @return int */ public function detach($ids = [], $touch = true) { if ($ids instanceof Model) { - $ids = (array) $ids->getKey(); + $ids = $ids->getKey(); + } + + if ($ids instanceof Collection) { + $ids = $ids->modelKeys(); } $query = $this->newPivotQuery(); @@ -1030,7 +1094,7 @@ public function detach($ids = [], $touch = true) $ids = (array) $ids; if (count($ids) > 0) { - $query->whereIn($this->otherKey, (array) $ids); + $query->whereIn($this->otherKey, $ids); } // Once we have all of the conditions set on the statement, we are ready @@ -1094,6 +1158,10 @@ protected function newPivotQuery() call_user_func_array([$query, 'where'], $whereArgs); } + foreach ($this->pivotWhereIns as $whereArgs) { + call_user_func_array([$query, 'whereIn'], $whereArgs); + } + return $query->where($this->foreignKey, $this->parent->getKey()); } @@ -1200,7 +1268,7 @@ public function updatedAt() */ public function getRelatedFreshUpdate() { - return [$this->related->getUpdatedAtColumn() => $this->related->freshTimestamp()]; + return [$this->related->getUpdatedAtColumn() => $this->related->freshTimestampString()]; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasMany.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasMany.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php index 2ae4eea..b133e00 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\Expression; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\ModelNotFoundException; class HasManyThrough extends Relation @@ -78,19 +79,20 @@ public function addConstraints() } /** - * Add the constraints for a relationship count query. + * Add the constraints for a relationship query. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQuery(Builder $query, Builder $parent) + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { $parentTable = $this->parent->getTable(); $this->setJoin($query); - $query->select(new Expression('count(*)')); + $query->select($columns); $key = $this->wrap($parentTable.'.'.$this->firstKey); @@ -123,7 +125,7 @@ protected function setJoin(Builder $query = null) */ public function parentSoftDeletes() { - return in_array('Illuminate\Database\Eloquent\SoftDeletes', class_uses_recursive(get_class($this->parent))); + return in_array(SoftDeletes::class, class_uses_recursive(get_class($this->parent))); } /** @@ -242,7 +244,7 @@ public function firstOrFail($columns = ['*']) return $model; } - throw new ModelNotFoundException; + throw (new ModelNotFoundException)->setModel(get_class($this->parent)); } /** @@ -320,13 +322,15 @@ public function get($columns = ['*']) $select = $this->getSelectColumns($columns); - $models = $this->query->addSelect($select)->getModels(); + $builder = $this->query->applyScopes(); + + $models = $builder->addSelect($select)->getModels(); // If we actually found models we will also eager load any relationships that // have been specified as needing to be eager loaded. This will solve the // n + 1 query problem for the developer and also increase performance. if (count($models) > 0) { - $models = $this->query->eagerLoadRelations($models); + $models = $builder->eagerLoadRelations($models); } return $this->related->newCollection($models); diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOne.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOne.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php old mode 100644 new mode 100755 index dcf4de6..c54c4da --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasOneOrMany.php @@ -23,6 +23,13 @@ abstract class HasOneOrMany extends Relation */ protected $localKey; + /** + * The count of self joins. + * + * @var int + */ + protected static $selfJoinCount = 0; + /** * Create a new has one or many relationship instance. * @@ -55,31 +62,33 @@ public function addConstraints() } /** - * Add the constraints for a relationship count query. + * Add the constraints for a relationship query. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQuery(Builder $query, Builder $parent) + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { if ($parent->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationCountQueryForSelfRelation($query, $parent); + return $this->getRelationQueryForSelfRelation($query, $parent, $columns); } - return parent::getRelationCountQuery($query, $parent); + return parent::getRelationQuery($query, $parent, $columns); } /** - * Add the constraints for a relationship count query on the same table. + * Add the constraints for a relationship query on the same table. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQueryForSelfRelation(Builder $query, Builder $parent) + public function getRelationQueryForSelfRelation(Builder $query, Builder $parent, $columns = ['*']) { - $query->select(new Expression('count(*)')); + $query->select($columns); $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); @@ -97,7 +106,7 @@ public function getRelationCountQueryForSelfRelation(Builder $query, Builder $pa */ public function getRelationCountHash() { - return 'self_'.md5(microtime(true)); + return 'laravel_reserved_'.static::$selfJoinCount++; } /** @@ -207,7 +216,7 @@ protected function buildDictionary(Collection $results) * Attach a model instance to the parent model. * * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model|false + * @return \Illuminate\Database\Eloquent\Model */ public function save(Model $model) { @@ -219,8 +228,8 @@ public function save(Model $model) /** * Attach a collection of models to the parent instance. * - * @param \Illuminate\Database\Eloquent\Collection|array $models - * @return \Illuminate\Database\Eloquent\Collection|array + * @param \Traversable|array $models + * @return \Traversable|array */ public function saveMany($models) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphMany.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphMany.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOne.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOne.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php old mode 100644 new mode 100755 index 658452c..3ba9b11 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphOneOrMany.php @@ -55,15 +55,16 @@ public function addConstraints() } /** - * Get the relationship count query. + * Get the relationship query. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQuery(Builder $query, Builder $parent) + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { - $query = parent::getRelationCountQuery($query, $parent); + $query = parent::getRelationQuery($query, $parent, $columns); return $query->where($this->morphType, $this->morphClass); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php index 94b6feb..a767bbf 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphTo.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Eloquent\Relations; +use BadMethodCallException; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; @@ -29,12 +30,12 @@ class MorphTo extends BelongsTo */ protected $dictionary = []; - /* - * Indicates if soft-deleted model instances should be fetched. + /** + * A buffer of dynamic calls to query macros. * - * @var bool + * @var array */ - protected $withTrashed = false; + protected $macroBuffer = []; /** * Create a new morph to relationship instance. @@ -182,9 +183,9 @@ protected function getResultsByType($type) $key = $instance->getTable().'.'.$instance->getKeyName(); - $query = $instance->newQuery()->with($this->getQuery()->getEagerLoads()); - - $query = $this->useWithTrashed($query); + $query = $this->replayMacros($instance->newQuery()) + ->mergeModelDefinedRelationConstraints($this->getQuery()) + ->with($this->getQuery()->getEagerLoads()); return $query->whereIn($key, $this->gatherKeysByType($type)->all())->get(); } @@ -238,31 +239,40 @@ public function getDictionary() } /** - * Fetch soft-deleted model instances with query. + * Replay stored macro calls on the actual related instance. * - * @return $this + * @param \Illuminate\Database\Eloquent\Builder $query + * @return \Illuminate\Database\Eloquent\Builder */ - public function withTrashed() + protected function replayMacros(Builder $query) { - $this->withTrashed = true; - - $this->query = $this->useWithTrashed($this->query); + foreach ($this->macroBuffer as $macro) { + call_user_func_array([$query, $macro['method']], $macro['parameters']); + } - return $this; + return $query; } /** - * Return trashed models with query if told so. + * Handle dynamic method calls to the relationship. * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder + * @param string $method + * @param array $parameters + * @return mixed */ - protected function useWithTrashed(Builder $query) + public function __call($method, $parameters) { - if ($this->withTrashed && $query->getMacro('withTrashed') !== null) { - return $query->withTrashed(); + try { + return parent::__call($method, $parameters); } - return $query; + // If we tried to call a method that does not exist on the parent Builder instance, + // we'll assume that we want to call a query macro (e.g. withTrashed) that only + // exists on related models. We will just store the call and replay it later. + catch (BadMethodCallException $e) { + $this->macroBuffer[] = compact('method', 'parameters'); + + return $this; + } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php index 373005d..7f124a6 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphToMany.php @@ -72,11 +72,12 @@ protected function setWhere() * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns * @return \Illuminate\Database\Eloquent\Builder */ - public function getRelationCountQuery(Builder $query, Builder $parent) + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) { - $query = parent::getRelationCountQuery($query, $parent); + $query = parent::getRelationQuery($query, $parent, $columns); return $query->where($this->table.'.'.$this->morphType, $this->morphClass); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php old mode 100644 new mode 100755 index 4d80279..0c4c274 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php @@ -69,6 +69,24 @@ public function __construct(Model $parent, $attributes, $table, $exists = false) $this->timestamps = $this->hasTimestampAttributes(); } + /** + * Create a new pivot model from raw values returned from a query. + * + * @param \Illuminate\Database\Eloquent\Model $parent + * @param array $attributes + * @param string $table + * @param bool $exists + * @return static + */ + public static function fromRawAttributes(Model $parent, $attributes, $table, $exists = false) + { + $instance = new static($parent, $attributes, $table, $exists); + + $instance->setRawAttributes($attributes, true); + + return $instance; + } + /** * Set the keys for a save update query. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php old mode 100644 new mode 100755 index 739cd37..23000b8 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Relation.php @@ -145,7 +145,20 @@ public function rawUpdate(array $attributes = []) */ public function getRelationCountQuery(Builder $query, Builder $parent) { - $query->select(new Expression('count(*)')); + return $this->getRelationQuery($query, $parent, new Expression('count(*)')); + } + + /** + * Add the constraints for a relationship query. + * + * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Builder $parent + * @param array|mixed $columns + * @return \Illuminate\Database\Eloquent\Builder + */ + public function getRelationQuery(Builder $query, Builder $parent, $columns = ['*']) + { + $query->select($columns); $key = $this->wrap($this->getQualifiedParentKeyName()); diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php new file mode 100644 index 0000000..63cba6a --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Scope.php @@ -0,0 +1,15 @@ +forceDeleting = true; - $this->delete(); + $deleted = $this->delete(); $this->forceDeleting = false; + + return $deleted; } /** @@ -101,30 +103,6 @@ public function trashed() return ! is_null($this->{$this->getDeletedAtColumn()}); } - /** - * Get a new query builder that includes soft deletes. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public static function withTrashed() - { - return (new static)->newQueryWithoutScope(new SoftDeletingScope); - } - - /** - * Get a new query builder that only includes soft deletes. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public static function onlyTrashed() - { - $instance = new static; - - $column = $instance->getQualifiedDeletedAtColumn(); - - return $instance->newQueryWithoutScope(new SoftDeletingScope)->whereNotNull($column); - } - /** * Register a restoring model event with the dispatcher. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php index f8786cf..86770d7 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletingScope.php @@ -2,14 +2,14 @@ namespace Illuminate\Database\Eloquent; -class SoftDeletingScope implements ScopeInterface +class SoftDeletingScope implements Scope { /** * All of the extensions to be added to the builder. * * @var array */ - protected $extensions = ['ForceDelete', 'Restore', 'WithTrashed', 'OnlyTrashed']; + protected $extensions = ['ForceDelete', 'Restore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed']; /** * Apply the scope to a given Eloquent query builder. @@ -21,26 +21,6 @@ class SoftDeletingScope implements ScopeInterface public function apply(Builder $builder, Model $model) { $builder->whereNull($model->getQualifiedDeletedAtColumn()); - - $this->extend($builder); - } - - /** - * Remove the scope from the given Eloquent query builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - public function remove(Builder $builder, Model $model) - { - $column = $model->getQualifiedDeletedAtColumn(); - - $query = $builder->getQuery(); - - $query->wheres = collect($query->wheres)->reject(function ($where) use ($column) { - return $this->isSoftDeleteConstraint($where, $column); - })->values()->all(); } /** @@ -116,40 +96,45 @@ protected function addRestore(Builder $builder) protected function addWithTrashed(Builder $builder) { $builder->macro('withTrashed', function (Builder $builder) { - $this->remove($builder, $builder->getModel()); - - return $builder; + return $builder->withoutGlobalScope($this); }); } /** - * Add the only-trashed extension to the builder. + * Add the without-trashed extension to the builder. * * @param \Illuminate\Database\Eloquent\Builder $builder * @return void */ - protected function addOnlyTrashed(Builder $builder) + protected function addWithoutTrashed(Builder $builder) { - $builder->macro('onlyTrashed', function (Builder $builder) { + $builder->macro('withoutTrashed', function (Builder $builder) { $model = $builder->getModel(); - $this->remove($builder, $model); - - $builder->getQuery()->whereNotNull($model->getQualifiedDeletedAtColumn()); + $builder->withoutGlobalScope($this)->whereNull( + $model->getQualifiedDeletedAtColumn() + ); return $builder; }); } /** - * Determine if the given where clause is a soft delete constraint. + * Add the only-trashed extension to the builder. * - * @param array $where - * @param string $column - * @return bool + * @param \Illuminate\Database\Eloquent\Builder $builder + * @return void */ - protected function isSoftDeleteConstraint(array $where, $column) + protected function addOnlyTrashed(Builder $builder) { - return $where['type'] == 'Null' && $where['column'] == $column; + $builder->macro('onlyTrashed', function (Builder $builder) { + $model = $builder->getModel(); + + $builder->withoutGlobalScope($this)->whereNotNull( + $model->getQualifiedDeletedAtColumn() + ); + + return $builder; + }); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php b/application/vendor/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php new file mode 100644 index 0000000..818c785 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Events/ConnectionEvent.php @@ -0,0 +1,32 @@ +connection = $connection; + $this->connectionName = $connection->getName(); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php b/application/vendor/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php new file mode 100644 index 0000000..e32b55f --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Events/QueryExecuted.php @@ -0,0 +1,58 @@ +sql = $sql; + $this->time = $time; + $this->bindings = $bindings; + $this->connection = $connection; + $this->connectionName = $connection->getName(); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php b/application/vendor/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php new file mode 100644 index 0000000..3287b5c --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Events/TransactionBeginning.php @@ -0,0 +1,8 @@ +registerMigrator(); + $this->registerCreator(); + $this->registerCommands(); } @@ -71,6 +73,18 @@ protected function registerMigrator() }); } + /** + * Register the migration creator. + * + * @return void + */ + protected function registerCreator() + { + $this->app->singleton('migration.creator', function ($app) { + return new MigrationCreator($app['files']); + }); + } + /** * Register all of the migration commands. * @@ -146,30 +160,6 @@ protected function registerRefreshCommand() }); } - /** - * Register the "status" migration command. - * - * @return void - */ - protected function registerStatusCommand() - { - $this->app->singleton('command.migrate.status', function ($app) { - return new StatusCommand($app['migrator']); - }); - } - - /** - * Register the "install" migration command. - * - * @return void - */ - protected function registerInstallCommand() - { - $this->app->singleton('command.migrate.install', function ($app) { - return new InstallCommand($app['migration.repository']); - }); - } - /** * Register the "make" migration command. * @@ -177,8 +167,6 @@ protected function registerInstallCommand() */ protected function registerMakeCommand() { - $this->registerCreator(); - $this->app->singleton('command.migrate.make', function ($app) { // Once we have the migration creator registered, we will create the command // and inject the creator. The creator is responsible for the actual file @@ -192,14 +180,26 @@ protected function registerMakeCommand() } /** - * Register the migration creator. + * Register the "status" migration command. * * @return void */ - protected function registerCreator() + protected function registerStatusCommand() { - $this->app->singleton('migration.creator', function ($app) { - return new MigrationCreator($app['files']); + $this->app->singleton('command.migrate.status', function ($app) { + return new StatusCommand($app['migrator']); + }); + } + + /** + * Register the "install" migration command. + * + * @return void + */ + protected function registerInstallCommand() + { + $this->app->singleton('command.migrate.install', function ($app) { + return new InstallCommand($app['migration.repository']); }); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php old mode 100644 new mode 100755 index 13f3da4..d7b6aa9 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php @@ -50,7 +50,7 @@ public function getRan() return $this->table() ->orderBy('batch', 'asc') ->orderBy('migration', 'asc') - ->lists('migration'); + ->pluck('migration'); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migration.php b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migration.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php old mode 100644 new mode 100755 index beacfe1..16b1a2d --- a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationCreator.php @@ -4,6 +4,7 @@ use Closure; use Illuminate\Support\Str; +use InvalidArgumentException; use Illuminate\Filesystem\Filesystem; class MigrationCreator @@ -41,9 +42,12 @@ public function __construct(Filesystem $files) * @param string $table * @param bool $create * @return string + * @throws \Exception */ public function create($name, $path, $table = null, $create = false) { + $this->ensureMigrationDoesntAlreadyExist($name); + $path = $this->getPath($name, $path); // First we will get the stub file for the migration, which serves as a type @@ -58,6 +62,21 @@ public function create($name, $path, $table = null, $create = false) return $path; } + /** + * Ensure that a migration with the given name doesn't already exist. + * + * @param string $name + * @return void + * + * @throws \InvalidArgumentException + */ + protected function ensureMigrationDoesntAlreadyExist($name) + { + if (class_exists($className = $this->getClassName($name))) { + throw new InvalidArgumentException("A $className migration already exists."); + } + } + /** * Get the migration stub file. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/MigrationRepositoryInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php old mode 100644 new mode 100755 index e69178a..6efb4c1 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Migrations; +use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Filesystem\Filesystem; use Illuminate\Database\ConnectionResolverInterface as Resolver; @@ -64,10 +65,10 @@ public function __construct(MigrationRepositoryInterface $repository, * Run the outstanding migrations at a given path. * * @param string $path - * @param bool $pretend + * @param array $options * @return void */ - public function run($path, $pretend = false) + public function run($path, array $options = []) { $this->notes = []; @@ -82,17 +83,17 @@ public function run($path, $pretend = false) $this->requireFiles($path, $migrations); - $this->runMigrationList($migrations, $pretend); + $this->runMigrationList($migrations, $options); } /** * Run an array of migrations. * * @param array $migrations - * @param bool $pretend + * @param array $options * @return void */ - public function runMigrationList($migrations, $pretend = false) + public function runMigrationList($migrations, array $options = []) { // First we will just make sure that there are any migrations to run. If there // aren't, we will just make a note of it to the developer so they're aware @@ -105,11 +106,22 @@ public function runMigrationList($migrations, $pretend = false) $batch = $this->repository->getNextBatchNumber(); + $pretend = Arr::get($options, 'pretend', false); + + $step = Arr::get($options, 'step', false); + // Once we have the array of migrations, we will spin through them and run the // migrations "up" so the changes are made to the databases. We'll then log // that the migration was run so we don't repeat it next time we execute. foreach ($migrations as $file) { $this->runUp($file, $batch, $pretend); + + // If we are stepping through the migrations, then we will increment the + // batch value for each individual migration that is run. That way we + // can run "artisan migrate:rollback" and undo them one at a time. + if ($step) { + $batch++; + } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/blank.stub b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/blank.stub old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/create.stub b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/create.stub old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/update.stub b/application/vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs/update.stub old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php b/application/vendor/laravel/framework/src/Illuminate/Database/MySqlConnection.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/PostgresConnection.php b/application/vendor/laravel/framework/src/Illuminate/Database/PostgresConnection.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php old mode 100644 new mode 100755 index 929ec01..06fdf8d --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php @@ -3,10 +3,12 @@ namespace Illuminate\Database\Query; use Closure; +use RuntimeException; use BadMethodCallException; use Illuminate\Support\Arr; use Illuminate\Support\Str; use InvalidArgumentException; +use Illuminate\Support\Collection; use Illuminate\Pagination\Paginator; use Illuminate\Support\Traits\Macroable; use Illuminate\Contracts\Support\Arrayable; @@ -193,7 +195,7 @@ class Builder '&', '|', '^', '<<', '>>', 'rlike', 'regexp', 'not regexp', '~', '~*', '!~', '!~*', 'similar to', - 'not similar to', + 'not similar to', 'not ilike', '~~*', '!~~*', ]; /** @@ -212,12 +214,12 @@ class Builder * @return void */ public function __construct(ConnectionInterface $connection, - Grammar $grammar, - Processor $processor) + Grammar $grammar = null, + Processor $processor = null) { - $this->grammar = $grammar; - $this->processor = $processor; $this->connection = $connection; + $this->grammar = $grammar ?: $connection->getQueryGrammar(); + $this->processor = $processor ?: $connection->getPostProcessor(); } /** @@ -257,6 +259,8 @@ public function selectRaw($expression, array $bindings = []) * @param \Closure|\Illuminate\Database\Query\Builder|string $query * @param string $as * @return \Illuminate\Database\Query\Builder|static + * + * @throws \InvalidArgumentException */ public function selectSub($query, $as) { @@ -432,6 +436,44 @@ public function rightJoinWhere($table, $one, $operator, $two) return $this->joinWhere($table, $one, $operator, $two, 'right'); } + /** + * Add a "cross join" clause to the query. + * + * @param string $table + * @param string $first + * @param string $operator + * @param string $second + * @return \Illuminate\Database\Query\Builder|static + */ + public function crossJoin($table, $first = null, $operator = null, $second = null) + { + if ($first) { + return $this->join($table, $first, $operator, $second, 'cross'); + } + + $this->joins[] = new JoinClause('cross', $table); + + return $this; + } + + /** + * Apply the callback's query changes if the given "value" is true. + * + * @param bool $value + * @param \Closure $callback + * @return \Illuminate\Database\Query\Builder + */ + public function when($value, $callback) + { + $builder = $this; + + if ($value) { + $builder = call_user_func($callback, $builder); + } + + return $builder; + } + /** * Add a basic where clause to the query. * @@ -449,11 +491,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' // and can add them each as a where clause. We will maintain the boolean we // received when the method was called and pass it into the nested where. if (is_array($column)) { - return $this->whereNested(function ($query) use ($column) { - foreach ($column as $key => $value) { - $query->where($key, '=', $value); - } - }, $boolean); + return $this->addArrayOfWheres($column, $boolean); } // Here we will make some assumptions about the operator. If only 2 values are @@ -475,7 +513,8 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' // If the given operator is not found in the list of valid operators we will // assume that the developer is just short-cutting the '=' operators and // we will set the operators to '=' and set the values appropriately. - if (! in_array(strtolower($operator), $this->operators, true)) { + if (! in_array(strtolower($operator), $this->operators, true) && + ! in_array(strtolower($operator), $this->grammar->getOperators(), true)) { list($value, $operator) = [$operator, '=']; } @@ -498,6 +537,10 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' // will be bound to each SQL statements when it is finally executed. $type = 'Basic'; + if (Str::contains($column, '->') && is_bool($value)) { + $value = new Expression($value ? 'true' : 'false'); + } + $this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof Expression) { @@ -507,6 +550,41 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' return $this; } + /** + * Add an array of where clauses to the query. + * + * @param array $column + * @param string $boolean + * @param string $method + * @return $this + */ + protected function addArrayOfWheres($column, $boolean, $method = 'where') + { + return $this->whereNested(function ($query) use ($column, $method) { + foreach ($column as $key => $value) { + if (is_numeric($key) && is_array($value)) { + call_user_func_array([$query, $method], $value); + } else { + $query->$method($key, '=', $value); + } + } + }, $boolean); + } + + /** + * Determine if the given operator and value combination is legal. + * + * @param string $operator + * @param mixed $value + * @return bool + */ + protected function invalidOperatorAndValue($operator, $value) + { + $isOperator = in_array($operator, $this->operators); + + return is_null($value) && $isOperator && ! in_array($operator, ['=', '<>', '!=']); + } + /** * Add an "or where" clause to the query. * @@ -521,17 +599,49 @@ public function orWhere($column, $operator = null, $value = null) } /** - * Determine if the given operator and value combination is legal. + * Add a "where" clause comparing two columns to the query. * - * @param string $operator - * @param mixed $value - * @return bool + * @param string|array $first + * @param string|null $operator + * @param string|null $second + * @param string|null $boolean + * @return \Illuminate\Database\Query\Builder|static */ - protected function invalidOperatorAndValue($operator, $value) + public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') { - $isOperator = in_array($operator, $this->operators); + // If the column is an array, we will assume it is an array of key-value pairs + // and can add them each as a where clause. We will maintain the boolean we + // received when the method was called and pass it into the nested where. + if (is_array($first)) { + return $this->addArrayOfWheres($first, $boolean, 'whereColumn'); + } + + // If the given operator is not found in the list of valid operators we will + // assume that the developer is just short-cutting the '=' operators and + // we will set the operators to '=' and set the values appropriately. + if (! in_array(strtolower($operator), $this->operators, true) && + ! in_array(strtolower($operator), $this->grammar->getOperators(), true)) { + list($second, $operator) = [$operator, '=']; + } + + $type = 'Column'; + + $this->wheres[] = compact('type', 'first', 'operator', 'second', 'boolean'); - return $isOperator && $operator != '=' && is_null($value); + return $this; + } + + /** + * Add an "or where" clause comparing two columns to the query. + * + * @param string|array $first + * @param string|null $operator + * @param string|null $second + * @return \Illuminate\Database\Query\Builder|static + */ + public function orWhereColumn($first, $operator = null, $second = null) + { + return $this->whereColumn($first, $operator, $second, 'or'); } /** @@ -631,18 +741,25 @@ public function orWhereNotBetween($column, array $values) */ public function whereNested(Closure $callback, $boolean = 'and') { - // To handle nested queries we'll actually create a brand new query instance - // and pass it off to the Closure that we have. The Closure can simply do - // do whatever it wants to a query then we will store it for compiling. - $query = $this->newQuery(); - - $query->from($this->from); + $query = $this->forNestedWhere(); call_user_func($callback, $query); return $this->addNestedWhereQuery($query, $boolean); } + /** + * Create a new query instance for nested where condition. + * + * @return \Illuminate\Database\Query\Builder + */ + public function forNestedWhere() + { + $query = $this->newQuery(); + + return $query->from($this->from); + } + /** * Add another query builder as a nested where to the query builder. * @@ -700,8 +817,6 @@ protected function whereSub($column, $operator, Closure $callback, $boolean) */ public function whereExists(Closure $callback, $boolean = 'and', $not = false) { - $type = $not ? 'NotExists' : 'Exists'; - $query = $this->newQuery(); // Similar to the sub-select clause, we will create a new query instance so @@ -709,11 +824,7 @@ public function whereExists(Closure $callback, $boolean = 'and', $not = false) // compile the whole thing in the grammar and insert it into the SQL. call_user_func($callback, $query); - $this->wheres[] = compact('type', 'operator', 'query', 'boolean'); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; + return $this->addWhereExistsQuery($query, $boolean, $not); } /** @@ -751,6 +862,25 @@ public function orWhereNotExists(Closure $callback) return $this->orWhereExists($callback, true); } + /** + * Add an exists clause to the query. + * + * @param \Illuminate\Database\Query\Builder $query + * @param string $boolean + * @param bool $not + * @return $this + */ + public function addWhereExistsQuery(Builder $query, $boolean = 'and', $not = false) + { + $type = $not ? 'NotExists' : 'Exists'; + + $this->wheres[] = compact('type', 'operator', 'query', 'boolean'); + + $this->addBinding($query->getBindings(), 'where'); + + return $this; + } + /** * Add a "where in" clause to the query. * @@ -935,6 +1065,46 @@ public function whereDate($column, $operator, $value, $boolean = 'and') return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean); } + /** + * Add an "or where date" statement to the query. + * + * @param string $column + * @param string $operator + * @param int $value + * @return \Illuminate\Database\Query\Builder|static + */ + public function orWhereDate($column, $operator, $value) + { + return $this->whereDate($column, $operator, $value, 'or'); + } + + /** + * Add a "where time" statement to the query. + * + * @param string $column + * @param string $operator + * @param int $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder|static + */ + public function whereTime($column, $operator, $value, $boolean = 'and') + { + return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean); + } + + /** + * Add an "or where time" statement to the query. + * + * @param string $column + * @param string $operator + * @param int $value + * @return \Illuminate\Database\Query\Builder|static + */ + public function orWhereTime($column, $operator, $value) + { + return $this->whereTime($column, $operator, $value, 'or'); + } + /** * Add a "where day" statement to the query. * @@ -978,7 +1148,7 @@ public function whereYear($column, $operator, $value, $boolean = 'and') } /** - * Add a date based (year, month, day) statement to the query. + * Add a date based (year, month, day, time) statement to the query. * * @param string $type * @param string $column @@ -1146,10 +1316,10 @@ public function orHavingRaw($sql, array $bindings = []) */ public function orderBy($column, $direction = 'asc') { - $property = $this->unions ? 'unionOrders' : 'orders'; - $direction = strtolower($direction) == 'asc' ? 'asc' : 'desc'; - - $this->{$property}[] = compact('column', 'direction'); + $this->{$this->unions ? 'unionOrders' : 'orders'}[] = [ + 'column' => $column, + 'direction' => strtolower($direction) == 'asc' ? 'asc' : 'desc', + ]; return $this; } @@ -1176,6 +1346,17 @@ public function oldest($column = 'created_at') return $this->orderBy($column, 'asc'); } + /** + * Put the query's results in random order. + * + * @param string $seed + * @return $this + */ + public function inRandomOrder($seed = '') + { + return $this->orderByRaw($this->grammar->compileRandom($seed)); + } + /** * Add a raw "order by" clause to the query. * @@ -1262,6 +1443,26 @@ public function forPage($page, $perPage = 15) return $this->skip(($page - 1) * $perPage)->take($perPage); } + /** + * Constrain the query to the next "page" of results after a given ID. + * + * @param int $perPage + * @param int $lastId + * @param string $column + * @return \Illuminate\Database\Query\Builder|static + */ + public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') + { + $this->orders = Collection::make($this->orders) + ->reject(function ($order) use ($column) { + return $order['column'] === $column; + })->values()->all(); + + return $this->where($column, '>', $lastId) + ->orderBy($column, 'asc') + ->take($perPage); + } + /** * Add a union statement to the query. * @@ -1365,21 +1566,6 @@ public function value($column) return count($result) > 0 ? reset($result) : null; } - /** - * Get a single column's value from the first result of a query. - * - * This is an alias for the "value" method. - * - * @param string $column - * @return mixed - * - * @deprecated since version 5.1. - */ - public function pluck($column) - { - return $this->value($column); - } - /** * Execute the query and get the first result. * @@ -1401,24 +1587,17 @@ public function first($columns = ['*']) */ public function get($columns = ['*']) { - if (is_null($this->columns)) { + $original = $this->columns; + + if (is_null($original)) { $this->columns = $columns; } - return $this->processor->processSelect($this, $this->runSelect()); - } + $results = $this->processor->processSelect($this, $this->runSelect()); - /** - * Execute the query as a fresh "select" statement. - * - * @param array $columns - * @return array|static[] - * - * @deprecated since version 5.1. Use get instead. - */ - public function getFresh($columns = ['*']) - { - return $this->get($columns); + $this->columns = $original; + + return $results; } /** @@ -1446,7 +1625,7 @@ public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $p $total = $this->getCountForPagination($columns); - $results = $this->forPage($page, $perPage)->get($columns); + $results = $total ? $this->forPage($page, $perPage)->get($columns) : []; return new LengthAwarePaginator($results, $total, $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), @@ -1462,11 +1641,12 @@ public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $p * @param int $perPage * @param array $columns * @param string $pageName + * @param int|null $page * @return \Illuminate\Contracts\Pagination\Paginator */ - public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page') + public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) { - $page = Paginator::resolveCurrentPage($pageName); + $page = $page ?: Paginator::resolveCurrentPage($pageName); $this->skip(($page - 1) * $perPage)->take($perPage + 1); @@ -1554,12 +1734,28 @@ protected function restoreFieldsForCount() $this->bindingBackups = []; } + /** + * Get a generator for the given query. + * + * @return \Generator + */ + public function cursor() + { + if (is_null($this->columns)) { + $this->columns = ['*']; + } + + return $this->connection->cursor( + $this->toSql(), $this->getBindings(), ! $this->useWritePdo + ); + } + /** * Chunk the results of the query. * * @param int $count * @param callable $callback - * @return bool + * @return bool */ public function chunk($count, callable $callback) { @@ -1581,6 +1777,60 @@ public function chunk($count, callable $callback) return true; } + /** + * Chunk the results of a query by comparing numeric IDs. + * + * @param int $count + * @param callable $callback + * @param string $column + * @param string $alias + * @return bool + */ + public function chunkById($count, callable $callback, $column = 'id', $alias = null) + { + $lastId = null; + + $alias = $alias ?: $column; + + $results = $this->forPageAfterId($count, 0, $column)->get(); + + while (! empty($results)) { + if (call_user_func($callback, $results) === false) { + return false; + } + + $lastId = last($results)->{$alias}; + + $results = $this->forPageAfterId($count, $lastId, $column)->get(); + } + + return true; + } + + /** + * Execute a callback over each item while chunking. + * + * @param callable $callback + * @param int $count + * @return bool + * + * @throws \RuntimeException + */ + public function each(callable $callback, $count = 1000) + { + if (is_null($this->orders) && is_null($this->unionOrders)) { + throw new RuntimeException('You must specify an orderBy clause when using the "each" function.'); + } + + return $this->chunk($count, function ($results) use ($callback) { + foreach ($results as $key => $value) { + if ($callback($value, $key) === false) { + return false; + } + } + }); + } + /** * Get an array with the values of a given column. * @@ -1588,7 +1838,7 @@ public function chunk($count, callable $callback) * @param string|null $key * @return array */ - public function lists($column, $key = null) + public function pluck($column, $key = null) { $results = $this->get(is_null($key) ? [$column] : [$column, $key]); @@ -1602,6 +1852,20 @@ public function lists($column, $key = null) ); } + /** + * Alias for the "pluck" method. + * + * @param string $column + * @param string|null $key + * @return array + * + * @deprecated since version 5.2. Use the "pluck" method directly. + */ + public function lists($column, $key = null) + { + return $this->pluck($column, $key); + } + /** * Strip off the table name or alias from a column identifier. * @@ -1622,7 +1886,7 @@ protected function stripTableForPluck($column) */ public function implode($column, $glue = '') { - return implode($glue, $this->lists($column)); + return implode($glue, $this->pluck($column)); } /** @@ -1855,7 +2119,25 @@ public function update(array $values) $sql = $this->grammar->compileUpdate($this, $values); - return $this->connection->update($sql, $this->cleanBindings($bindings)); + return $this->connection->update($sql, $this->cleanBindings( + $this->grammar->prepareBindingsForUpdate($bindings, $values) + )); + } + + /** + * Insert or update a record matching the attributes, and fill it with values. + * + * @param array $attributes + * @param array $values + * @return bool + */ + public function updateOrInsert(array $attributes, array $values = []) + { + if (! $this->where($attributes)->exists()) { + return $this->insert(array_merge($attributes, $values)); + } + + return (bool) $this->where($attributes)->take(1)->update($values); } /** @@ -2118,7 +2400,7 @@ public function __call($method, $parameters) return $this->dynamicWhere($method, $parameters); } - $className = get_class($this); + $className = static::class; throw new BadMethodCallException("Call to undefined method {$className}::{$method}()"); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Expression.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Expression.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php old mode 100644 new mode 100755 index 5a871ad..4f51016 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php @@ -7,6 +7,13 @@ class Grammar extends BaseGrammar { + /** + * The grammar specific operators. + * + * @var array + */ + protected $operators = []; + /** * The components that make up a select clause. * @@ -35,11 +42,17 @@ class Grammar extends BaseGrammar */ public function compileSelect(Builder $query) { + $original = $query->columns; + if (is_null($query->columns)) { $query->columns = ['*']; } - return trim($this->concatenate($this->compileComponents($query))); + $sql = trim($this->concatenate($this->compileComponents($query))); + + $query->columns = $original; + + return $sql; } /** @@ -134,6 +147,17 @@ protected function compileJoins(Builder $query, $joins) foreach ($joins as $join) { $table = $this->wrapTable($join->table); + $type = $join->type; + + // Cross joins generate a cartesian product between this first table and a joined + // table. In case the user didn't specify any "on" clauses on the join we will + // append this SQL and jump right back into the next iteration of this loop. + if ($type === 'cross' && ! $join->clauses) { + $sql[] = "cross join $table"; + + continue; + } + // First we need to build all of the "on" clauses for the join. There may be many // of these clauses so we will need to iterate through each one and build them // separately, then we'll join them up into a single string when we're done. @@ -150,8 +174,6 @@ protected function compileJoins(Builder $query, $joins) $clauses = implode(' ', $clauses); - $type = $join->type; - // Once we have everything ready to go, we will just concatenate all the parts to // build the final join statement SQL for the query and we can then return the // final clause back to the callers as a single, stringified join statement. @@ -286,6 +308,20 @@ protected function whereBasic(Builder $query, $where) return $this->wrap($where['column']).' '.$where['operator'].' '.$value; } + /** + * Compile a where clause comparing two columns.. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + protected function whereColumn(Builder $query, $where) + { + $second = $this->wrap($where['second']); + + return $this->wrap($where['first']).' '.$where['operator'].' '.$second; + } + /** * Compile a "between" where clause. * @@ -424,6 +460,18 @@ protected function whereDate(Builder $query, $where) return $this->dateBasedWhere('date', $query, $where); } + /** + * Compile a "where time" clause. + * + * @param \Illuminate\Database\Query\Builder $query + * @param array $where + * @return string + */ + protected function whereTime(Builder $query, $where) + { + return $this->dateBasedWhere('time', $query, $where); + } + /** * Compile a "where day" clause. * @@ -564,6 +612,17 @@ protected function compileOrders(Builder $query, $orders) }, $orders)); } + /** + * Compile the random statement into SQL. + * + * @param string $seed + * @return string + */ + public function compileRandom($seed) + { + return 'RANDOM()'; + } + /** * Compile the "limit" portions of the query. * @@ -729,6 +788,18 @@ public function compileUpdate(Builder $query, $values) return trim("update {$table}{$joins} set $columns $where"); } + /** + * Prepare the bindings for an update statement. + * + * @param array $bindings + * @param array $values + * @return array + */ + public function prepareBindingsForUpdate(array $bindings, array $values) + { + return $bindings; + } + /** * Compile a delete statement into SQL. * @@ -822,4 +893,14 @@ protected function removeLeadingBoolean($value) { return preg_replace('/and |or /i', '', $value, 1); } + + /** + * Get the gramar specific operators. + * + * @return array + */ + public function getOperators() + { + return $this->operators; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php old mode 100644 new mode 100755 index e48221c..fbcad27 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php @@ -2,7 +2,9 @@ namespace Illuminate\Database\Query\Grammars; +use Illuminate\Support\Str; use Illuminate\Database\Query\Builder; +use Illuminate\Database\Query\JsonExpression; class MySqlGrammar extends Grammar { @@ -55,6 +57,17 @@ protected function compileUnion(array $union) return $joiner.'('.$union['query']->toSql().')'; } + /** + * Compile the random statement into SQL. + * + * @param string $seed + * @return string + */ + public function compileRandom($seed) + { + return 'RAND('.$seed.')'; + } + /** * Compile the lock into SQL. * @@ -80,7 +93,40 @@ protected function compileLock(Builder $query, $value) */ public function compileUpdate(Builder $query, $values) { - $sql = parent::compileUpdate($query, $values); + $table = $this->wrapTable($query->from); + + $columns = []; + + // Each one of the columns in the update statements needs to be wrapped in the + // keyword identifiers, also a place-holder needs to be created for each of + // the values in the list of bindings so we can make the sets statements. + foreach ($values as $key => $value) { + if ($this->isJsonSelector($key)) { + $columns[] = $this->compileJsonUpdateColumn( + $key, new JsonExpression($value) + ); + } else { + $columns[] = $this->wrap($key).' = '.$this->parameter($value); + } + } + + $columns = implode(', ', $columns); + + // If the query has any "join" clauses, we will setup the joins on the builder + // and compile them so we can attach them to this update, as update queries + // can get join statements to attach to other tables when they're needed. + if (isset($query->joins)) { + $joins = ' '.$this->compileJoins($query, $query->joins); + } else { + $joins = ''; + } + + // Of course, update queries may also be constrained by where clauses so we'll + // need to compile the where clauses and attach it to the query so only the + // intended records are updated by the SQL statements we generate to run. + $where = $this->compileWheres($query); + + $sql = rtrim("update {$table}{$joins} set $columns $where"); if (isset($query->orders)) { $sql .= ' '.$this->compileOrders($query, $query->orders); @@ -93,6 +139,46 @@ public function compileUpdate(Builder $query, $values) return rtrim($sql); } + /** + * Prepares a JSON column being updated using the JSON_SET function. + * + * @param string $key + * @param \Illuminate\Database\JsonExpression $value + * @return string + */ + protected function compileJsonUpdateColumn($key, JsonExpression $value) + { + $path = explode('->', $key); + + $field = $this->wrapValue(array_shift($path)); + + $accessor = '"$.'.implode('.', $path).'"'; + + return "{$field} = json_set({$field}, {$accessor}, {$value->getValue()})"; + } + + /** + * Prepare the bindings for an update statement. + * + * @param array $bindings + * @param array $values + * @return array + */ + public function prepareBindingsForUpdate(array $bindings, array $values) + { + $index = 0; + + foreach ($values as $column => $value) { + if ($this->isJsonSelector($column) && is_bool($value)) { + unset($bindings[$index]); + } + + $index++; + } + + return $bindings; + } + /** * Compile a delete statement into SQL. * @@ -136,6 +222,36 @@ protected function wrapValue($value) return $value; } + if ($this->isJsonSelector($value)) { + return $this->wrapJsonSelector($value); + } + return '`'.str_replace('`', '``', $value).'`'; } + + /** + * Wrap the given JSON selector. + * + * @param string $value + * @return string + */ + protected function wrapJsonSelector($value) + { + $path = explode('->', $value); + + $field = $this->wrapValue(array_shift($path)); + + return $field.'->'.'"$.'.implode('.', $path).'"'; + } + + /** + * Determine if the given string is a JSON selector. + * + * @param string $value + * @return bool + */ + protected function isJsonSelector($value) + { + return Str::contains($value, '->'); + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php old mode 100644 new mode 100755 index 5582649..7f43d99 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Query\Grammars; +use Illuminate\Support\Str; use Illuminate\Database\Query\Builder; class PostgresGrammar extends Grammar @@ -15,6 +16,7 @@ class PostgresGrammar extends Grammar '=', '<', '>', '<=', '>=', '<>', '!=', 'like', 'not like', 'between', 'ilike', '&', '|', '#', '<<', '>>', + '@>', '<@', '?', '?|', '?&', '||', '-', '-', '#-', ]; /** @@ -44,43 +46,7 @@ protected function whereDate(Builder $query, $where) { $value = $this->parameter($where['value']); - return $this->wrap($where['column']).' '.$where['operator'].' '.$value.'::date'; - } - - /** - * Compile a "where day" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDay(Builder $query, $where) - { - return $this->dateBasedWhere('day', $query, $where); - } - - /** - * Compile a "where month" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereMonth(Builder $query, $where) - { - return $this->dateBasedWhere('month', $query, $where); - } - - /** - * Compile a "where year" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereYear(Builder $query, $where) - { - return $this->dateBasedWhere('year', $query, $where); + return $this->wrap($where['column']).'::date '.$where['operator'].' '.$value; } /** @@ -242,4 +208,59 @@ public function compileTruncate(Builder $query) { return ['truncate '.$this->wrapTable($query->from).' restart identity' => []]; } + + /** + * Wrap a single string in keyword identifiers. + * + * @param string $value + * @return string + */ + protected function wrapValue($value) + { + if ($value === '*') { + return $value; + } + + if (Str::contains($value, '->')) { + return $this->wrapJsonSelector($value); + } + + return '"'.str_replace('"', '""', $value).'"'; + } + + /** + * Wrap the given JSON selector. + * + * @param string $value + * @return string + */ + protected function wrapJsonSelector($value) + { + $path = explode('->', $value); + + $field = $this->wrapValue(array_shift($path)); + + $wrappedPath = $this->wrapJsonPathAttributes($path); + + $attribute = array_pop($wrappedPath); + + if (! empty($wrappedPath)) { + return $field.'->'.implode('->', $wrappedPath).'->>'.$attribute; + } + + return $field.'->>'.$attribute; + } + + /** + * Wrap the attributes of the give JSON path. + * + * @param array $path + * @return array + */ + protected function wrapJsonPathAttributes($path) + { + return array_map(function ($attribute) { + return "'$attribute'"; + }, $path); + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php old mode 100644 new mode 100755 index b36e94c..057f09a --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/SqlServerGrammar.php @@ -25,6 +25,8 @@ class SqlServerGrammar extends Grammar */ public function compileSelect(Builder $query) { + $original = $query->columns; + if (is_null($query->columns)) { $query->columns = ['*']; } @@ -38,7 +40,11 @@ public function compileSelect(Builder $query) return $this->compileAnsiOffset($query, $components); } - return $this->concatenate($components); + $sql = $this->concatenate($components); + + $query->columns = $original; + + return $sql; } /** @@ -168,6 +174,17 @@ protected function compileTableExpression($sql, $constraint) return "select * from ({$sql}) as temp_table where row_num {$constraint}"; } + /** + * Compile the random statement into SQL. + * + * @param string $seed + * @return string + */ + public function compileRandom($seed) + { + return 'NEWID()'; + } + /** * Compile the "limit" portions of the query. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/JoinClause.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/JsonExpression.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/JsonExpression.php new file mode 100644 index 0000000..648a7da --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/JsonExpression.php @@ -0,0 +1,70 @@ +value = $this->getJsonBindingParameter($value); + } + + /** + * Translate the given value into the appropriate JSON binding parameter. + * + * @param mixed $value + * @return string + */ + protected function getJsonBindingParameter($value) + { + switch ($type = gettype($value)) { + case 'boolean': + return $value ? 'true' : 'false'; + case 'integer': + case 'double': + return $value; + case 'string': + return '?'; + case 'object': + case 'array': + return '?'; + } + + throw new InvalidArgumentException('JSON value is of illegal type: '.$type); + } + + /** + * Get the value of the expression. + * + * @return mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * Get the value of the expression. + * + * @return string + */ + public function __toString() + { + return (string) $this->getValue(); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php old mode 100644 new mode 100755 index ab350cb..84376ce --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php @@ -17,13 +17,11 @@ class PostgresProcessor extends Processor */ public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) { - $results = $query->getConnection()->selectFromWriteConnection($sql, $values); + $result = $query->getConnection()->selectFromWriteConnection($sql, $values)[0]; $sequence = $sequence ?: 'id'; - $result = (array) $results[0]; - - $id = $result[$sequence]; + $id = is_object($result) ? $result->$sequence : $result[$sequence]; return is_numeric($id) ? (int) $id : $id; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php old mode 100644 new mode 100755 index 447a9c6..8830713 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/SqlServerProcessor.php @@ -2,6 +2,7 @@ namespace Illuminate\Database\Query\Processors; +use Exception; use Illuminate\Database\Query\Builder; class SqlServerProcessor extends Processor @@ -17,13 +18,38 @@ class SqlServerProcessor extends Processor */ public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) { - $query->getConnection()->insert($sql, $values); + $connection = $query->getConnection(); - $id = $query->getConnection()->getPdo()->lastInsertId(); + $connection->insert($sql, $values); + + if ($connection->getConfig('odbc') === true) { + $id = $this->processInsertGetIdForOdbc($connection); + } else { + $id = $connection->getPdo()->lastInsertId(); + } return is_numeric($id) ? (int) $id : $id; } + /** + * Process an "insert get ID" query for ODBC. + * + * @param \Illuminate\Database\Connection $connection + * @return int + */ + protected function processInsertGetIdForOdbc($connection) + { + $result = $connection->selectFromWriteConnection('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid'); + + if (! $result) { + throw new Exception('Unable to retrieve lastInsertID for ODBC.'); + } + + $row = $result[0]; + + return is_object($row) ? $row->insertid : $row['insertid']; + } + /** * Process the results of a column listing query. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/README.md b/application/vendor/laravel/framework/src/Illuminate/Database/README.md old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php b/application/vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php old mode 100644 new mode 100755 index 9786fcb..68b714e --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php @@ -278,7 +278,7 @@ public function dropIndex($index) /** * Indicate that the given foreign key should be dropped. * - * @param string $index + * @param string|array $index * @return \Illuminate\Support\Fluent */ public function dropForeign($index) @@ -775,25 +775,25 @@ public function timestampTz($column) /** * Add nullable creation and update timestamps to the table. * + * Alias for self::timestamps(). + * * @return void */ public function nullableTimestamps() { - $this->timestamp('created_at')->nullable(); - - $this->timestamp('updated_at')->nullable(); + $this->timestamps(); } /** - * Add creation and update timestamps to the table. + * Add nullable creation and update timestamps to the table. * * @return void */ public function timestamps() { - $this->timestamp('created_at'); + $this->timestamp('created_at')->nullable(); - $this->timestamp('updated_at'); + $this->timestamp('updated_at')->nullable(); } /** @@ -803,9 +803,9 @@ public function timestamps() */ public function timestampsTz() { - $this->timestampTz('created_at'); + $this->timestampTz('created_at')->nullable(); - $this->timestampTz('updated_at'); + $this->timestampTz('updated_at')->nullable(); } /** @@ -840,6 +840,28 @@ public function uuid($column) return $this->addColumn('uuid', $column); } + /** + * Create a new IP address column on the table. + * + * @param string $column + * @return \Illuminate\Support\Fluent + */ + public function ipAddress($column) + { + return $this->addColumn('ipAddress', $column); + } + + /** + * Create a new MAC address column on the table. + * + * @param string $column + * @return \Illuminate\Support\Fluent + */ + public function macAddress($column) + { + return $this->addColumn('macAddress', $column); + } + /** * Add the proper columns for a polymorphic table. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php old mode 100644 new mode 100755 index 5e10b42..74341dd --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php @@ -89,6 +89,20 @@ public function hasColumns($table, array $columns) return true; } + /** + * Get the data type for the given column name. + * + * @param string $table + * @param string $column + * @return string + */ + public function getColumnType($table, $column) + { + $table = $this->connection->getTablePrefix().$table; + + return $this->connection->getDoctrineColumn($table, $column)->getType()->getName(); + } + /** * Get the column listing for a given table. * @@ -180,6 +194,30 @@ public function rename($from, $to) $this->build($blueprint); } + /** + * Enable foreign key constraints. + * + * @return bool + */ + public function enableForeignKeyConstraints() + { + return $this->connection->statement( + $this->grammar->compileEnableForeignKeyConstraints() + ); + } + + /** + * Disable foreign key constraints. + * + * @return bool + */ + public function disableForeignKeyConstraints() + { + return $this->connection->statement( + $this->grammar->compileDisableForeignKeyConstraints() + ); + } + /** * Execute the blueprint to build / modify the table. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php old mode 100644 new mode 100755 index 9dbc170..ddf918f --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/Grammar.php @@ -82,6 +82,8 @@ public function compileForeign(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); + $index = $this->wrap($command->index); + $on = $this->wrapTable($command->on); // We need to prepare several of the elements of the foreign key definition @@ -91,7 +93,7 @@ public function compileForeign(Blueprint $blueprint, Fluent $command) $onColumns = $this->columnize((array) $command->references); - $sql = "alter table {$table} add constraint {$command->index} "; + $sql = "alter table {$table} add constraint {$index} "; $sql .= "foreign key ({$columns}) references {$on} ({$onColumns})"; @@ -276,6 +278,8 @@ protected function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $sch * @param \Illuminate\Support\Fluent $command * @param \Illuminate\Database\Connection $connection * @return array + * + * @throws \RuntimeException */ public function compileChange(Blueprint $blueprint, Fluent $command, Connection $connection) { @@ -392,6 +396,9 @@ protected function getDoctrineColumnType($type) case 'longtext': $type = 'text'; break; + case 'binary': + $type = 'blob'; + break; } return Type::getType($type); diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php old mode 100644 new mode 100755 index 3687882..fd6e42a --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php @@ -13,7 +13,10 @@ class MySqlGrammar extends Grammar * * @var array */ - protected $modifiers = ['Unsigned', 'Charset', 'Collate', 'Nullable', 'Default', 'Increment', 'Comment', 'After', 'First']; + protected $modifiers = [ + 'VirtualAs', 'StoredAs', 'Unsigned', 'Charset', 'Collate', 'Nullable', + 'Default', 'Increment', 'Comment', 'After', 'First', + ]; /** * The possible column serials. @@ -65,6 +68,8 @@ public function compileCreate(Blueprint $blueprint, Fluent $command, Connection if (isset($blueprint->engine)) { $sql .= ' engine = '.$blueprint->engine; + } elseif (! is_null($engine = $connection->getConfig('engine'))) { + $sql .= ' engine = '.$engine; } return $sql; @@ -163,7 +168,9 @@ protected function compileKey(Blueprint $blueprint, Fluent $command, $type) $table = $this->wrapTable($blueprint); - return "alter table {$table} add {$type} `{$command->index}`($columns)"; + $index = $this->wrap($command->index); + + return "alter table {$table} add {$type} {$index}($columns)"; } /** @@ -229,7 +236,9 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop index `{$command->index}`"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop index {$index}"; } /** @@ -243,7 +252,9 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop index `{$command->index}`"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop index {$index}"; } /** @@ -257,7 +268,9 @@ public function compileDropForeign(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop foreign key `{$command->index}`"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop foreign key {$index}"; } /** @@ -274,6 +287,26 @@ public function compileRename(Blueprint $blueprint, Fluent $command) return "rename table {$from} to ".$this->wrapTable($command->to); } + /** + * Compile the command to enable foreign key constraints. + * + * @return string + */ + public function compileEnableForeignKeyConstraints() + { + return 'SET FOREIGN_KEY_CHECKS=1;'; + } + + /** + * Compile the command to disable foreign key constraints. + * + * @return string + */ + public function compileDisableForeignKeyConstraints() + { + return 'SET FOREIGN_KEY_CHECKS=0;'; + } + /** * Create the column definition for a char type. * @@ -451,7 +484,7 @@ protected function typeEnum(Fluent $column) */ protected function typeJson(Fluent $column) { - return 'text'; + return 'json'; } /** @@ -462,7 +495,7 @@ protected function typeJson(Fluent $column) */ protected function typeJsonb(Fluent $column) { - return 'text'; + return 'json'; } /** @@ -532,10 +565,6 @@ protected function typeTimestamp(Fluent $column) return 'timestamp default CURRENT_TIMESTAMP'; } - if (! $column->nullable && $column->default === null) { - return 'timestamp default 0'; - } - return 'timestamp'; } @@ -551,10 +580,6 @@ protected function typeTimestampTz(Fluent $column) return 'timestamp default CURRENT_TIMESTAMP'; } - if (! $column->nullable && $column->default === null) { - return 'timestamp default 0'; - } - return 'timestamp'; } @@ -580,6 +605,56 @@ protected function typeUuid(Fluent $column) return 'char(36)'; } + /** + * Create the column definition for an IP address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeIpAddress(Fluent $column) + { + return 'varchar(45)'; + } + + /** + * Create the column definition for a MAC address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeMacAddress(Fluent $column) + { + return 'varchar(17)'; + } + + /** + * Get the SQL for a generated virtual column modifier. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column + * @return string|null + */ + protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) + { + if (! is_null($column->virtualAs)) { + return " as ({$column->virtualAs})"; + } + } + + /** + * Get the SQL for a generated stored column modifier. + * + * @param \Illuminate\Database\Schema\Blueprint $blueprint + * @param \Illuminate\Support\Fluent $column + * @return string|null + */ + protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) + { + if (! is_null($column->storedAs)) { + return " as ({$column->storedAs}) stored"; + } + } + /** * Get the SQL for an unsigned column modifier. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php old mode 100644 new mode 100755 index aad33f1..72d3fc9 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -61,7 +61,7 @@ public function compileCreate(Blueprint $blueprint, Fluent $command) } /** - * Compile a create table command. + * Compile a column addition command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command @@ -101,9 +101,11 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); + $index = $this->wrap($command->index); + $columns = $this->columnize($command->columns); - return "alter table $table add constraint {$command->index} unique ($columns)"; + return "alter table $table add constraint {$index} unique ($columns)"; } /** @@ -117,7 +119,9 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) { $columns = $this->columnize($command->columns); - return "create index {$command->index} on ".$this->wrapTable($blueprint)." ({$columns})"; + $index = $this->wrap($command->index); + + return "create index {$index} on ".$this->wrapTable($blueprint)." ({$columns})"; } /** @@ -171,7 +175,9 @@ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) { $table = $blueprint->getTable(); - return 'alter table '.$this->wrapTable($blueprint)." drop constraint {$table}_pkey"; + $index = $this->wrap("{$table}_pkey"); + + return 'alter table '.$this->wrapTable($blueprint)." drop constraint {$index}"; } /** @@ -185,7 +191,9 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop constraint {$command->index}"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop constraint {$index}"; } /** @@ -197,7 +205,9 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) */ public function compileDropIndex(Blueprint $blueprint, Fluent $command) { - return "drop index {$command->index}"; + $index = $this->wrap($command->index); + + return "drop index {$index}"; } /** @@ -211,7 +221,29 @@ public function compileDropForeign(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop constraint {$command->index}"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop constraint {$index}"; + } + + /** + * Compile the command to enable foreign key constraints. + * + * @return string + */ + public function compileEnableForeignKeyConstraints() + { + return 'SET CONSTRAINTS ALL IMMEDIATE;'; + } + + /** + * Compile the command to disable foreign key constraints. + * + * @return string + */ + public function compileDisableForeignKeyConstraints() + { + return 'SET CONSTRAINTS ALL DEFERRED;'; } /** @@ -526,6 +558,28 @@ protected function typeUuid(Fluent $column) return 'uuid'; } + /** + * Create the column definition for an IP address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeIpAddress(Fluent $column) + { + return 'inet'; + } + + /** + * Create the column definition for a MAC address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeMacAddress(Fluent $column) + { + return 'macaddr'; + } + /** * Get the SQL for a nullable column modifier. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php old mode 100644 new mode 100755 index a257de7..9c040be --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php @@ -170,7 +170,9 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) $table = $this->wrapTable($blueprint); - return "create unique index {$command->index} on {$table} ({$columns})"; + $index = $this->wrap($command->index); + + return "create unique index {$index} on {$table} ({$columns})"; } /** @@ -186,7 +188,9 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) $table = $this->wrapTable($blueprint); - return "create index {$command->index} on {$table} ({$columns})"; + $index = $this->wrap($command->index); + + return "create index {$index} on {$table} ({$columns})"; } /** @@ -257,7 +261,9 @@ public function compileDropColumn(Blueprint $blueprint, Fluent $command, Connect */ public function compileDropUnique(Blueprint $blueprint, Fluent $command) { - return "drop index {$command->index}"; + $index = $this->wrap($command->index); + + return "drop index {$index}"; } /** @@ -269,7 +275,9 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) */ public function compileDropIndex(Blueprint $blueprint, Fluent $command) { - return "drop index {$command->index}"; + $index = $this->wrap($command->index); + + return "drop index {$index}"; } /** @@ -286,6 +294,26 @@ public function compileRename(Blueprint $blueprint, Fluent $command) return "alter table {$from} rename to ".$this->wrapTable($command->to); } + /** + * Compile the command to enable foreign key constraints. + * + * @return string + */ + public function compileEnableForeignKeyConstraints() + { + return 'PRAGMA foreign_keys = ON;'; + } + + /** + * Compile the command to disable foreign key constraints. + * + * @return string + */ + public function compileDisableForeignKeyConstraints() + { + return 'PRAGMA foreign_keys = OFF;'; + } + /** * Create the column definition for a char type. * @@ -583,6 +611,28 @@ protected function typeUuid(Fluent $column) return 'varchar'; } + /** + * Create the column definition for an IP address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeIpAddress(Fluent $column) + { + return 'varchar'; + } + + /** + * Create the column definition for a MAC address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeMacAddress(Fluent $column) + { + return 'varchar'; + } + /** * Get the SQL for a nullable column modifier. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php old mode 100644 new mode 100755 index ba5d245..c527660 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php @@ -59,7 +59,7 @@ public function compileCreate(Blueprint $blueprint, Fluent $command) } /** - * Compile a create table command. + * Compile a column addition table command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command @@ -87,7 +87,9 @@ public function compilePrimary(Blueprint $blueprint, Fluent $command) $table = $this->wrapTable($blueprint); - return "alter table {$table} add constraint {$command->index} primary key ({$columns})"; + $index = $this->wrap($command->index); + + return "alter table {$table} add constraint {$index} primary key ({$columns})"; } /** @@ -103,7 +105,9 @@ public function compileUnique(Blueprint $blueprint, Fluent $command) $table = $this->wrapTable($blueprint); - return "create unique index {$command->index} on {$table} ({$columns})"; + $index = $this->wrap($command->index); + + return "create unique index {$index} on {$table} ({$columns})"; } /** @@ -119,7 +123,9 @@ public function compileIndex(Blueprint $blueprint, Fluent $command) $table = $this->wrapTable($blueprint); - return "create index {$command->index} on {$table} ({$columns})"; + $index = $this->wrap($command->index); + + return "create index {$index} on {$table} ({$columns})"; } /** @@ -143,7 +149,7 @@ public function compileDrop(Blueprint $blueprint, Fluent $command) */ public function compileDropIfExists(Blueprint $blueprint, Fluent $command) { - return 'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = \''.$blueprint->getTable().'\') drop table '.$blueprint->getTable(); + return 'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = \''.$blueprint->getTable().'\') drop table ['.$blueprint->getTable().']'; } /** @@ -173,7 +179,9 @@ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop constraint {$command->index}"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop constraint {$index}"; } /** @@ -187,7 +195,9 @@ public function compileDropUnique(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "drop index {$command->index} on {$table}"; + $index = $this->wrap($command->index); + + return "drop index {$index} on {$table}"; } /** @@ -201,7 +211,9 @@ public function compileDropIndex(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "drop index {$command->index} on {$table}"; + $index = $this->wrap($command->index); + + return "drop index {$index} on {$table}"; } /** @@ -215,7 +227,9 @@ public function compileDropForeign(Blueprint $blueprint, Fluent $command) { $table = $this->wrapTable($blueprint); - return "alter table {$table} drop constraint {$command->index}"; + $index = $this->wrap($command->index); + + return "alter table {$table} drop constraint {$index}"; } /** @@ -232,6 +246,26 @@ public function compileRename(Blueprint $blueprint, Fluent $command) return "sp_rename {$from}, ".$this->wrapTable($command->to); } + /** + * Compile the command to enable foreign key constraints. + * + * @return string + */ + public function compileEnableForeignKeyConstraints() + { + return 'EXEC sp_msforeachtable @command1="print \'?\'", @command2="ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all";'; + } + + /** + * Compile the command to disable foreign key constraints. + * + * @return string + */ + public function compileDisableForeignKeyConstraints() + { + return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";'; + } + /** * Create the column definition for a char type. * @@ -528,6 +562,28 @@ protected function typeUuid(Fluent $column) return 'uniqueidentifier'; } + /** + * Create the column definition for an IP address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeIpAddress(Fluent $column) + { + return 'nvarchar(45)'; + } + + /** + * Create the column definition for a MAC address type. + * + * @param \Illuminate\Support\Fluent $column + * @return string + */ + protected function typeMacAddress(Fluent $column) + { + return 'nvarchar(17)'; + } + /** * Get the SQL for a nullable column modifier. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php old mode 100644 new mode 100755 index da3fd60..20abc0f --- a/application/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Schema/PostgresBuilder.php @@ -16,8 +16,6 @@ public function hasTable($table) $schema = $this->connection->getConfig('schema'); - $schema = $schema ? $schema : 'public'; - $table = $this->connection->getTablePrefix().$table; return count($this->connection->select($sql, [$schema, $table])) > 0; diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/SeedServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Database/SeedServiceProvider.php old mode 100644 new mode 100755 index 3a97cde..417e86a --- a/application/vendor/laravel/framework/src/Illuminate/Database/SeedServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/SeedServiceProvider.php @@ -4,7 +4,6 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Database\Console\Seeds\SeedCommand; -use Illuminate\Database\Console\Seeds\SeederMakeCommand; class SeedServiceProvider extends ServiceProvider { @@ -22,15 +21,13 @@ class SeedServiceProvider extends ServiceProvider */ public function register() { - $this->registerSeedCommand(); - - $this->registerMakeCommand(); - $this->app->singleton('seeder', function () { return new Seeder; }); - $this->commands('command.seed', 'command.seeder.make'); + $this->registerSeedCommand(); + + $this->commands('command.seed'); } /** @@ -45,18 +42,6 @@ protected function registerSeedCommand() }); } - /** - * Register the seeder generator command. - * - * @return void - */ - protected function registerMakeCommand() - { - $this->app->singleton('command.seeder.make', function ($app) { - return new SeederMakeCommand($app['files'], $app['composer']); - }); - } - /** * Get the services provided by the provider. * @@ -64,6 +49,6 @@ protected function registerMakeCommand() */ public function provides() { - return ['seeder', 'command.seed', 'command.seeder.make']; + return ['seeder', 'command.seed']; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/Seeder.php b/application/vendor/laravel/framework/src/Illuminate/Database/Seeder.php old mode 100644 new mode 100755 index 4e29c16..a9d9ef6 --- a/application/vendor/laravel/framework/src/Illuminate/Database/Seeder.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/Seeder.php @@ -5,7 +5,7 @@ use Illuminate\Console\Command; use Illuminate\Container\Container; -class Seeder +abstract class Seeder { /** * The container instance. @@ -26,10 +26,7 @@ class Seeder * * @return void */ - public function run() - { - // - } + abstract public function run(); /** * Seed the given connection from the given path. diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php b/application/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php old mode 100644 new mode 100755 index fa097e2..2d848a8 --- a/application/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php +++ b/application/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php @@ -18,7 +18,7 @@ class SqlServerConnection extends Connection * @param \Closure $callback * @return mixed * - * @throws \Throwable + * @throws \Exception|\Throwable */ public function transaction(Closure $callback) { @@ -26,7 +26,7 @@ public function transaction(Closure $callback) return parent::transaction($callback); } - $this->pdo->exec('BEGIN TRAN'); + $this->getPdo()->exec('BEGIN TRAN'); // We'll simply execute the given callback within a try / catch block // and if we catch any exception we can rollback the transaction @@ -34,18 +34,18 @@ public function transaction(Closure $callback) try { $result = $callback($this); - $this->pdo->exec('COMMIT TRAN'); + $this->getPdo()->exec('COMMIT TRAN'); } // If we catch an exception, we will roll back so nothing gets messed // up in the database. Then we'll re-throw the exception so it can // be handled how the developer sees fit for their applications. catch (Exception $e) { - $this->pdo->exec('ROLLBACK TRAN'); + $this->getPdo()->exec('ROLLBACK TRAN'); throw $e; } catch (Throwable $e) { - $this->pdo->exec('ROLLBACK TRAN'); + $this->getPdo()->exec('ROLLBACK TRAN'); throw $e; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Database/composer.json b/application/vendor/laravel/framework/src/Illuminate/Database/composer.json index 26c462a..9fc4549 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Database/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Database/composer.json @@ -11,15 +11,15 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/container": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "nesbot/carbon": "~1.19" + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "nesbot/carbon": "~1.20" }, "autoload": { "psr-4": { @@ -28,16 +28,16 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "illuminate/console": "Required to use the database commands (5.1.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.1.*).", - "illuminate/filesystem": "Required to use the migrations (5.1.*).", - "illuminate/pagination": "Required to paginate the result set (5.1.*)." + "illuminate/console": "Required to use the database commands (5.2.*).", + "illuminate/events": "Required to use the observers with Eloquent (5.2.*).", + "illuminate/filesystem": "Required to use the migrations (5.2.*).", + "illuminate/pagination": "Required to paginate the result set (5.2.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Encryption/BaseEncrypter.php b/application/vendor/laravel/framework/src/Illuminate/Encryption/BaseEncrypter.php index 1d427af..4fcd4ee 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Encryption/BaseEncrypter.php +++ b/application/vendor/laravel/framework/src/Illuminate/Encryption/BaseEncrypter.php @@ -2,7 +2,6 @@ namespace Illuminate\Encryption; -use Illuminate\Support\Str; use Illuminate\Contracts\Encryption\DecryptException; abstract class BaseEncrypter @@ -73,10 +72,10 @@ protected function invalidPayload($data) */ protected function validMac(array $payload) { - $bytes = Str::randomBytes(16); + $bytes = random_bytes(16); $calcMac = hash_hmac('sha256', $this->hash($payload['iv'], $payload['value']), $bytes, true); - return Str::equals(hash_hmac('sha256', $payload['mac'], $bytes, true), $calcMac); + return hash_equals(hash_hmac('sha256', $payload['mac'], $bytes, true), $calcMac); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php b/application/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php old mode 100644 new mode 100755 index 71a0ddc..e4db751 --- a/application/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php +++ b/application/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php @@ -3,7 +3,6 @@ namespace Illuminate\Encryption; use RuntimeException; -use Illuminate\Support\Str; use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Contracts\Encryption\EncryptException; use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract; @@ -62,7 +61,7 @@ public static function supported($key, $cipher) */ public function encrypt($value) { - $iv = Str::randomBytes($this->getIvSize()); + $iv = random_bytes($this->getIvSize()); $value = \openssl_encrypt(serialize($value), $this->cipher, $this->key, 0, $iv); diff --git a/application/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php old mode 100644 new mode 100755 index a0b9491..dba6b57 --- a/application/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php @@ -3,6 +3,7 @@ namespace Illuminate\Encryption; use RuntimeException; +use Illuminate\Support\Str; use Illuminate\Support\ServiceProvider; class EncryptionServiceProvider extends ServiceProvider @@ -17,17 +18,31 @@ public function register() $this->app->singleton('encrypter', function ($app) { $config = $app->make('config')->get('app'); - $key = $config['key']; - - $cipher = $config['cipher']; - - if (Encrypter::supported($key, $cipher)) { - return new Encrypter($key, $cipher); - } elseif (McryptEncrypter::supported($key, $cipher)) { - return new McryptEncrypter($key, $cipher); - } else { - throw new RuntimeException('No supported encrypter found. The cipher and / or key length are invalid.'); + if (Str::startsWith($key = $config['key'], 'base64:')) { + $key = base64_decode(substr($key, 7)); } + + return $this->getEncrypterForKeyAndCipher($key, $config['cipher']); }); } + + /** + * Get the proper encrypter instance for the given key and cipher. + * + * @param string $key + * @param string $cipher + * @return mixed + * + * @throws \RuntimeException + */ + protected function getEncrypterForKeyAndCipher($key, $cipher) + { + if (Encrypter::supported($key, $cipher)) { + return new Encrypter($key, $cipher); + } elseif (McryptEncrypter::supported($key, $cipher)) { + return new McryptEncrypter($key, $cipher); + } else { + throw new RuntimeException('No supported encrypter found. The cipher and / or key length are invalid.'); + } + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Encryption/composer.json b/application/vendor/laravel/framework/src/Illuminate/Encryption/composer.json index 0b52c2a..a97264d 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Encryption/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Encryption/composer.json @@ -10,15 +10,15 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", "ext-mbstring": "*", "ext-openssl": "*", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", "paragonie/random_compat": "~1.4" }, "autoload": { @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php b/application/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Events/composer.json b/application/vendor/laravel/framework/src/Illuminate/Events/composer.json old mode 100644 new mode 100755 index 4cbe705..77ea29b --- a/application/vendor/laravel/framework/src/Illuminate/Events/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Events/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/container": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php b/application/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php index 11eb46c..e02bf6c 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php +++ b/application/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php @@ -27,19 +27,49 @@ public function exists($path) * Get the contents of a file. * * @param string $path + * @param bool $lock * @return string * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ - public function get($path) + public function get($path, $lock = false) { if ($this->isFile($path)) { - return file_get_contents($path); + return $lock ? $this->sharedGet($path) : file_get_contents($path); } throw new FileNotFoundException("File does not exist at path {$path}"); } + /** + * Get contents of a file with shared access. + * + * @param string $path + * @return string + */ + public function sharedGet($path) + { + $contents = ''; + + $handle = fopen($path, 'rb'); + + if ($handle) { + try { + if (flock($handle, LOCK_SH)) { + clearstatcache(true, $path); + + $contents = fread($handle, $this->size($path) ?: 1); + + flock($handle, LOCK_UN); + } + } finally { + fclose($handle); + } + } + + return $contents; + } + /** * Get the returned value of a file. * @@ -169,6 +199,28 @@ public function name($path) return pathinfo($path, PATHINFO_FILENAME); } + /** + * Extract the trailing name component from a file path. + * + * @param string $path + * @return string + */ + public function basename($path) + { + return pathinfo($path, PATHINFO_BASENAME); + } + + /** + * Extract the parent directory from a file path. + * + * @param string $path + * @return string + */ + public function dirname($path) + { + return pathinfo($path, PATHINFO_DIRNAME); + } + /** * Extract the file extension from a file path. * @@ -295,11 +347,12 @@ public function files($directory) * Get all of the files from the given directory (recursive). * * @param string $directory + * @param bool $hidden * @return array */ - public function allFiles($directory) + public function allFiles($directory, $hidden = false) { - return iterator_to_array(Finder::create()->files()->in($directory), false); + return iterator_to_array(Finder::create()->files()->ignoreDotFiles(! $hidden)->in($directory), false); } /** @@ -337,6 +390,25 @@ public function makeDirectory($path, $mode = 0755, $recursive = false, $force = return mkdir($path, $mode, $recursive); } + /** + * Move a directory. + * + * @param string $from + * @param string $to + * @param bool $overwrite + * @return bool + */ + public function moveDirectory($from, $to, $overwrite = false) + { + if ($overwrite && $this->isDirectory($to)) { + if (! $this->deleteDirectory($to)) { + return false; + } + } + + return @rename($from, $to) === true; + } + /** * Copy a directory from one location to another. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php b/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php index bb92370..d4b019e 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -2,13 +2,16 @@ namespace Illuminate\Filesystem; +use RuntimeException; use InvalidArgumentException; use Illuminate\Support\Collection; use League\Flysystem\AdapterInterface; use League\Flysystem\FilesystemInterface; +use League\Flysystem\AwsS3v3\AwsS3Adapter; use League\Flysystem\FileNotFoundException; -use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract; +use League\Flysystem\Adapter\Local as LocalAdapter; use Illuminate\Contracts\Filesystem\Filesystem as FilesystemContract; +use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract; use Illuminate\Contracts\Filesystem\FileNotFoundException as ContractFileNotFoundException; class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract @@ -116,10 +119,10 @@ public function setVisibility($path, $visibility) * @param string $data * @return int */ - public function prepend($path, $data) + public function prepend($path, $data, $separator = PHP_EOL) { if ($this->exists($path)) { - return $this->put($path, $data.PHP_EOL.$this->get($path)); + return $this->put($path, $data.$separator.$this->get($path)); } return $this->put($path, $data); @@ -132,10 +135,10 @@ public function prepend($path, $data) * @param string $data * @return int */ - public function append($path, $data) + public function append($path, $data, $separator = PHP_EOL) { if ($this->exists($path)) { - return $this->put($path, $this->get($path).PHP_EOL.$data); + return $this->put($path, $this->get($path).$separator.$data); } return $this->put($path, $data); @@ -152,7 +155,11 @@ public function delete($paths) $paths = is_array($paths) ? $paths : func_get_args(); foreach ($paths as $path) { - $this->driver->delete($path); + try { + $this->driver->delete($path); + } catch (FileNotFoundException $e) { + // + } } return true; @@ -215,6 +222,29 @@ public function lastModified($path) return $this->driver->getTimestamp($path); } + /** + * Get the URL for the file at the given path. + * + * @param string $path + * @return string + */ + public function url($path) + { + $adapter = $this->driver->getAdapter(); + + if ($adapter instanceof AwsS3Adapter) { + $path = $adapter->getPathPrefix().$path; + + return $adapter->getClient()->getObjectUrl($adapter->getBucket(), $path); + } elseif ($adapter instanceof LocalAdapter) { + return '/storage/'.$path; + } elseif (method_exists($adapter, 'getUrl')) { + return $adapter->getUrl($path); + } else { + throw new RuntimeException('This driver does not support retrieving URLs.'); + } + } + /** * Get an array of all files in a directory. * @@ -318,6 +348,7 @@ protected function filterContentsByType($contents, $type) * * @param string|null $visibility * @return string|null + * * @throws \InvalidArgumentException */ protected function parseVisibility($visibility) diff --git a/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php b/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php index 961c624..fd342c0 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php @@ -74,6 +74,18 @@ public function disk($name = null) return $this->disks[$name] = $this->get($name); } + /** + * Get a default cloud filesystem instance. + * + * @return \Illuminate\Contracts\Filesystem\Filesystem + */ + public function cloud() + { + $name = $this->getDefaultCloudDriver(); + + return $this->disks[$name] = $this->get($name); + } + /** * Attempt to get the disk from the local cache. * @@ -106,7 +118,7 @@ protected function resolve($name) if (method_exists($this, $driverMethod)) { return $this->{$driverMethod}($config); } else { - throw new InvalidArgumentException("Driver [{$config['driver']}] not supported."); + throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); } } @@ -175,8 +187,10 @@ public function createS3Driver(array $config) $root = isset($s3Config['root']) ? $s3Config['root'] : null; + $options = isset($config['options']) ? $config['options'] : []; + return $this->adapt($this->createFlysystem( - new S3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root), $config + new S3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options), $config )); } @@ -209,8 +223,10 @@ public function createRackspaceDriver(array $config) 'username' => $config['username'], 'apiKey' => $config['key'], ]); + $root = isset($config['root']) ? $config['root'] : null; + return $this->adapt($this->createFlysystem( - new RackspaceAdapter($this->getRackspaceContainer($client, $config)), $config + new RackspaceAdapter($this->getRackspaceContainer($client, $config), $root), $config )); } @@ -276,6 +292,16 @@ public function getDefaultDriver() return $this->app['config']['filesystems.default']; } + /** + * Get the default cloud driver name. + * + * @return string + */ + public function getDefaultCloudDriver() + { + return $this->app['config']['filesystems.cloud']; + } + /** * Register a custom driver creator Closure. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json b/application/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json index a00fa40..58506ee 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Filesystem/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/finder": "2.7.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/finder": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/AliasLoader.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/AliasLoader.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php old mode 100644 new mode 100755 index b890434..22e3960 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Application.php @@ -25,7 +25,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '5.1.46 (LTS)'; + const VERSION = '5.2.45'; /** * The base path for the Laravel installation. @@ -276,10 +276,13 @@ public function setBasePath($basePath) protected function bindPathsInContainer() { $this->instance('path', $this->path()); - - foreach (['base', 'config', 'database', 'lang', 'public', 'storage'] as $path) { - $this->instance('path.'.$path, $this->{$path.'Path'}()); - } + $this->instance('path.base', $this->basePath()); + $this->instance('path.lang', $this->langPath()); + $this->instance('path.config', $this->configPath()); + $this->instance('path.public', $this->publicPath()); + $this->instance('path.storage', $this->storagePath()); + $this->instance('path.database', $this->databasePath()); + $this->instance('path.bootstrap', $this->bootstrapPath()); } /** @@ -302,6 +305,16 @@ public function basePath() return $this->basePath; } + /** + * Get the path to the bootstrap directory. + * + * @return string + */ + public function bootstrapPath() + { + return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'; + } + /** * Get the path to the application configuration files. * @@ -428,11 +441,21 @@ public function environmentFile() return $this->environmentFile ?: '.env'; } + /** + * Get the fully qualified path to the environment file. + * + * @return string + */ + public function environmentFilePath() + { + return $this->environmentPath().'/'.$this->environmentFile(); + } + /** * Get or check the current application environment. * * @param mixed - * @return string + * @return string|bool */ public function environment() { @@ -800,7 +823,7 @@ public function shouldSkipMiddleware() */ public function configurationIsCached() { - return $this['files']->exists($this->getCachedConfigPath()); + return file_exists($this->getCachedConfigPath()); } /** @@ -810,7 +833,7 @@ public function configurationIsCached() */ public function getCachedConfigPath() { - return $this->basePath().'/bootstrap/cache/config.php'; + return $this->bootstrapPath().'/cache/config.php'; } /** @@ -830,7 +853,7 @@ public function routesAreCached() */ public function getCachedRoutesPath() { - return $this->basePath().'/bootstrap/cache/routes.php'; + return $this->bootstrapPath().'/cache/routes.php'; } /** @@ -840,17 +863,17 @@ public function getCachedRoutesPath() */ public function getCachedCompilePath() { - return $this->basePath().'/bootstrap/cache/compiled.php'; + return $this->bootstrapPath().'/cache/compiled.php'; } /** - * Get the path to the cached services.json file. + * Get the path to the cached services.php file. * * @return string */ public function getCachedServicesPath() { - return $this->basePath().'/bootstrap/cache/services.json'; + return $this->bootstrapPath().'/cache/services.php'; } /** @@ -1018,6 +1041,17 @@ public function setLocale($locale) $this['events']->fire('locale.changed', [$locale]); } + /** + * Determine if application locale is the given locale. + * + * @param string $locale + * @return bool + */ + public function isLocale($locale) + { + return $this->getLocale() == $locale; + } + /** * Register the core class aliases in the container. * @@ -1027,34 +1061,35 @@ public function registerCoreContainerAliases() { $aliases = [ 'app' => ['Illuminate\Foundation\Application', 'Illuminate\Contracts\Container\Container', 'Illuminate\Contracts\Foundation\Application'], - 'auth' => 'Illuminate\Auth\AuthManager', - 'auth.driver' => ['Illuminate\Auth\Guard', 'Illuminate\Contracts\Auth\Guard'], - 'auth.password.tokens' => 'Illuminate\Auth\Passwords\TokenRepositoryInterface', - 'blade.compiler' => 'Illuminate\View\Compilers\BladeCompiler', + 'auth' => ['Illuminate\Auth\AuthManager', 'Illuminate\Contracts\Auth\Factory'], + 'auth.driver' => ['Illuminate\Contracts\Auth\Guard'], + 'blade.compiler' => ['Illuminate\View\Compilers\BladeCompiler'], 'cache' => ['Illuminate\Cache\CacheManager', 'Illuminate\Contracts\Cache\Factory'], 'cache.store' => ['Illuminate\Cache\Repository', 'Illuminate\Contracts\Cache\Repository'], 'config' => ['Illuminate\Config\Repository', 'Illuminate\Contracts\Config\Repository'], 'cookie' => ['Illuminate\Cookie\CookieJar', 'Illuminate\Contracts\Cookie\Factory', 'Illuminate\Contracts\Cookie\QueueingFactory'], 'encrypter' => ['Illuminate\Encryption\Encrypter', 'Illuminate\Contracts\Encryption\Encrypter'], - 'db' => 'Illuminate\Database\DatabaseManager', + 'db' => ['Illuminate\Database\DatabaseManager'], 'db.connection' => ['Illuminate\Database\Connection', 'Illuminate\Database\ConnectionInterface'], 'events' => ['Illuminate\Events\Dispatcher', 'Illuminate\Contracts\Events\Dispatcher'], - 'files' => 'Illuminate\Filesystem\Filesystem', + 'files' => ['Illuminate\Filesystem\Filesystem'], 'filesystem' => ['Illuminate\Filesystem\FilesystemManager', 'Illuminate\Contracts\Filesystem\Factory'], - 'filesystem.disk' => 'Illuminate\Contracts\Filesystem\Filesystem', - 'filesystem.cloud' => 'Illuminate\Contracts\Filesystem\Cloud', - 'hash' => 'Illuminate\Contracts\Hashing\Hasher', + 'filesystem.disk' => ['Illuminate\Contracts\Filesystem\Filesystem'], + 'filesystem.cloud' => ['Illuminate\Contracts\Filesystem\Cloud'], + 'hash' => ['Illuminate\Contracts\Hashing\Hasher'], 'translator' => ['Illuminate\Translation\Translator', 'Symfony\Component\Translation\TranslatorInterface'], 'log' => ['Illuminate\Log\Writer', 'Illuminate\Contracts\Logging\Log', 'Psr\Log\LoggerInterface'], 'mailer' => ['Illuminate\Mail\Mailer', 'Illuminate\Contracts\Mail\Mailer', 'Illuminate\Contracts\Mail\MailQueue'], - 'auth.password' => ['Illuminate\Auth\Passwords\PasswordBroker', 'Illuminate\Contracts\Auth\PasswordBroker'], + 'auth.password' => ['Illuminate\Auth\Passwords\PasswordBrokerManager', 'Illuminate\Contracts\Auth\PasswordBrokerFactory'], + 'auth.password.broker' => ['Illuminate\Auth\Passwords\PasswordBroker', 'Illuminate\Contracts\Auth\PasswordBroker'], 'queue' => ['Illuminate\Queue\QueueManager', 'Illuminate\Contracts\Queue\Factory', 'Illuminate\Contracts\Queue\Monitor'], - 'queue.connection' => 'Illuminate\Contracts\Queue\Queue', - 'redirect' => 'Illuminate\Routing\Redirector', + 'queue.connection' => ['Illuminate\Contracts\Queue\Queue'], + 'queue.failer' => ['Illuminate\Queue\Failed\FailedJobProviderInterface'], + 'redirect' => ['Illuminate\Routing\Redirector'], 'redis' => ['Illuminate\Redis\Database', 'Illuminate\Contracts\Redis\Database'], - 'request' => 'Illuminate\Http\Request', + 'request' => ['Illuminate\Http\Request', 'Symfony\Component\HttpFoundation\Request'], 'router' => ['Illuminate\Routing\Router', 'Illuminate\Contracts\Routing\Registrar'], - 'session' => 'Illuminate\Session\SessionManager', + 'session' => ['Illuminate\Session\SessionManager'], 'session.store' => ['Illuminate\Session\Store', 'Symfony\Component\HttpFoundation\Session\SessionInterface'], 'url' => ['Illuminate\Routing\UrlGenerator', 'Illuminate\Contracts\Routing\UrlGenerator'], 'validator' => ['Illuminate\Validation\Factory', 'Illuminate\Contracts\Validation\Factory'], @@ -1062,7 +1097,7 @@ public function registerCoreContainerAliases() ]; foreach ($aliases as $key => $aliases) { - foreach ((array) $aliases as $alias) { + foreach ($aliases as $alias) { $this->alias($key, $alias); } } @@ -1080,20 +1115,6 @@ public function flush() $this->loadedProviders = []; } - /** - * Get the used kernel object. - * - * @return \Illuminate\Contracts\Console\Kernel|\Illuminate\Contracts\Http\Kernel - */ - protected function getKernel() - { - $kernelContract = $this->runningInConsole() - ? 'Illuminate\Contracts\Console\Kernel' - : 'Illuminate\Contracts\Http\Kernel'; - - return $this->make($kernelContract); - } - /** * Get the application namespace. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php index e3908f2..2abf9e2 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php @@ -3,8 +3,6 @@ namespace Illuminate\Foundation\Auth\Access; use Illuminate\Contracts\Auth\Access\Gate; -use Illuminate\Auth\Access\UnauthorizedException; -use Symfony\Component\HttpKernel\Exception\HttpException; trait AuthorizesRequests { @@ -15,13 +13,13 @@ trait AuthorizesRequests * @param mixed|array $arguments * @return \Illuminate\Auth\Access\Response * - * @throws \Symfony\Component\HttpKernel\Exception\HttpException + * @throws \Illuminate\Auth\Access\AuthorizationException */ public function authorize($ability, $arguments = []) { list($ability, $arguments) = $this->parseAbilityAndArguments($ability, $arguments); - return $this->authorizeAtGate(app(Gate::class), $ability, $arguments); + return app(Gate::class)->authorize($ability, $arguments); } /** @@ -32,36 +30,13 @@ public function authorize($ability, $arguments = []) * @param mixed|array $arguments * @return \Illuminate\Auth\Access\Response * - * @throws \Symfony\Component\HttpKernel\Exception\HttpException + * @throws \Illuminate\Auth\Access\AuthorizationException */ public function authorizeForUser($user, $ability, $arguments = []) { list($ability, $arguments) = $this->parseAbilityAndArguments($ability, $arguments); - $gate = app(Gate::class)->forUser($user); - - return $this->authorizeAtGate($gate, $ability, $arguments); - } - - /** - * Authorize the request at the given gate. - * - * @param \Illuminate\Contracts\Auth\Access\Gate $gate - * @param mixed $ability - * @param mixed|array $arguments - * @return \Illuminate\Auth\Access\Response - * - * @throws \Symfony\Component\HttpKernel\Exception\HttpException - */ - public function authorizeAtGate(Gate $gate, $ability, $arguments) - { - try { - return $gate->authorize($ability, $arguments); - } catch (UnauthorizedException $e) { - throw $this->createGateUnauthorizedException( - $ability, $arguments, $e->getMessage(), $e - ); - } + return app(Gate::class)->forUser($user)->authorize($ability, $arguments); } /** @@ -79,18 +54,4 @@ protected function parseAbilityAndArguments($ability, $arguments) return [debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'], $ability]; } - - /** - * Throw an unauthorized exception based on gate results. - * - * @param string $ability - * @param mixed|array $arguments - * @param string $message - * @param \Exception $previousException - * @return \Symfony\Component\HttpKernel\Exception\HttpException - */ - protected function createGateUnauthorizedException($ability, $arguments, $message = 'This action is unauthorized.', $previousException = null) - { - return new HttpException(403, $message, $previousException); - } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesResources.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesResources.php new file mode 100644 index 0000000..3242d33 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/Access/AuthorizesResources.php @@ -0,0 +1,49 @@ +resourceAbilityMap() as $method => $ability) { + $modelName = in_array($method, ['index', 'create', 'store']) ? $model : $parameter; + + $middleware["can:{$ability},{$modelName}"][] = $method; + } + + foreach ($middleware as $middlewareName => $methods) { + $this->middleware($middlewareName, $options)->only($methods); + } + } + + /** + * Get the map of resource methods to ability names. + * + * @return array + */ + protected function resourceAbilityMap() + { + return [ + 'index' => 'view', + 'create' => 'create', + 'store' => 'create', + 'show' => 'view', + 'edit' => 'update', + 'update' => 'update', + 'destroy' => 'delete', + ]; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php index 32ce2c7..8199e79 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php @@ -6,5 +6,6 @@ trait AuthenticatesAndRegistersUsers { use AuthenticatesUsers, RegistersUsers { AuthenticatesUsers::redirectPath insteadof RegistersUsers; + AuthenticatesUsers::getGuard insteadof RegistersUsers; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php index 2d1bc8c..6c20026 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php @@ -17,8 +17,21 @@ trait AuthenticatesUsers */ public function getLogin() { - if (view()->exists('auth.authenticate')) { - return view('auth.authenticate'); + return $this->showLoginForm(); + } + + /** + * Show the application login form. + * + * @return \Illuminate\Http\Response + */ + public function showLoginForm() + { + $view = property_exists($this, 'loginView') + ? $this->loginView : 'auth.authenticate'; + + if (view()->exists($view)) { + return view($view); } return view('auth.login'); @@ -32,37 +45,57 @@ public function getLogin() */ public function postLogin(Request $request) { - $this->validate($request, [ - $this->loginUsername() => 'required', 'password' => 'required', - ]); + return $this->login($request); + } + + /** + * Handle a login request to the application. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function login(Request $request) + { + $this->validateLogin($request); // If the class is using the ThrottlesLogins trait, we can automatically throttle // the login attempts for this application. We'll key this by the username and // the IP address of the client making these requests into this application. $throttles = $this->isUsingThrottlesLoginsTrait(); - if ($throttles && $this->hasTooManyLoginAttempts($request)) { + if ($throttles && $lockedOut = $this->hasTooManyLoginAttempts($request)) { + $this->fireLockoutEvent($request); + return $this->sendLockoutResponse($request); } $credentials = $this->getCredentials($request); - if (Auth::attempt($credentials, $request->has('remember'))) { + if (Auth::guard($this->getGuard())->attempt($credentials, $request->has('remember'))) { return $this->handleUserWasAuthenticated($request, $throttles); } // If the login attempt was unsuccessful we will increment the number of attempts // to login and redirect the user back to the login form. Of course, when this // user surpasses their maximum number of attempts they will get locked out. - if ($throttles) { + if ($throttles && ! $lockedOut) { $this->incrementLoginAttempts($request); } - return redirect($this->loginPath()) - ->withInput($request->only($this->loginUsername(), 'remember')) - ->withErrors([ - $this->loginUsername() => $this->getFailedLoginMessage(), - ]); + return $this->sendFailedLoginResponse($request); + } + + /** + * Validate the user login request. + * + * @param \Illuminate\Http\Request $request + * @return void + */ + protected function validateLogin(Request $request) + { + $this->validate($request, [ + $this->loginUsername() => 'required', 'password' => 'required', + ]); } /** @@ -79,21 +112,25 @@ protected function handleUserWasAuthenticated(Request $request, $throttles) } if (method_exists($this, 'authenticated')) { - return $this->authenticated($request, Auth::user()); + return $this->authenticated($request, Auth::guard($this->getGuard())->user()); } return redirect()->intended($this->redirectPath()); } /** - * Get the needed authorization credentials from the request. + * Get the failed login response instance. * - * @param \Illuminate\Http\Request $request - * @return array + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response */ - protected function getCredentials(Request $request) + protected function sendFailedLoginResponse(Request $request) { - return $request->only($this->loginUsername(), 'password'); + return redirect()->back() + ->withInput($request->only($this->loginUsername(), 'remember')) + ->withErrors([ + $this->loginUsername() => $this->getFailedLoginMessage(), + ]); } /** @@ -108,6 +145,17 @@ protected function getFailedLoginMessage() : 'These credentials do not match our records.'; } + /** + * Get the needed authorization credentials from the request. + * + * @param \Illuminate\Http\Request $request + * @return array + */ + protected function getCredentials(Request $request) + { + return $request->only($this->loginUsername(), 'password'); + } + /** * Log the user out of the application. * @@ -115,19 +163,29 @@ protected function getFailedLoginMessage() */ public function getLogout() { - Auth::logout(); + return $this->logout(); + } + + /** + * Log the user out of the application. + * + * @return \Illuminate\Http\Response + */ + public function logout() + { + Auth::guard($this->getGuard())->logout(); return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/'); } /** - * Get the path to the login route. - * - * @return string + * Get the guest middleware for the application. */ - public function loginPath() + public function guestMiddleware() { - return property_exists($this, 'loginPath') ? $this->loginPath : '/auth/login'; + $guard = $this->getGuard(); + + return $guard ? 'guest:'.$guard : 'guest'; } /** @@ -148,7 +206,17 @@ public function loginUsername() protected function isUsingThrottlesLoginsTrait() { return in_array( - ThrottlesLogins::class, class_uses_recursive(get_class($this)) + ThrottlesLogins::class, class_uses_recursive(static::class) ); } + + /** + * Get the guard to be used during authentication. + * + * @return string|null + */ + protected function getGuard() + { + return property_exists($this, 'guard') ? $this->guard : null; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php index 496abd6..e32d25f 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php @@ -16,6 +16,20 @@ trait RegistersUsers */ public function getRegister() { + return $this->showRegistrationForm(); + } + + /** + * Show the application registration form. + * + * @return \Illuminate\Http\Response + */ + public function showRegistrationForm() + { + if (property_exists($this, 'registerView')) { + return view($this->registerView); + } + return view('auth.register'); } @@ -26,6 +40,17 @@ public function getRegister() * @return \Illuminate\Http\Response */ public function postRegister(Request $request) + { + return $this->register($request); + } + + /** + * Handle a registration request for the application. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function register(Request $request) { $validator = $this->validator($request->all()); @@ -35,8 +60,18 @@ public function postRegister(Request $request) ); } - Auth::login($this->create($request->all())); + Auth::guard($this->getGuard())->login($this->create($request->all())); return redirect($this->redirectPath()); } + + /** + * Get the guard to be used during registration. + * + * @return string|null + */ + protected function getGuard() + { + return property_exists($this, 'guard') ? $this->guard : null; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php index 55d784d..85675c3 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ResetsPasswords.php @@ -2,16 +2,28 @@ namespace Illuminate\Foundation\Auth; +use Illuminate\Support\Str; use Illuminate\Http\Request; use Illuminate\Mail\Message; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Password; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; trait ResetsPasswords { use RedirectsUsers; + /** + * Get the name of the guest middleware. + * + * @return string + */ + protected function guestMiddleware() + { + $guard = $this->getGuard(); + + return $guard ? 'guest:'.$guard : 'guest'; + } + /** * Display the form to request a password reset link. * @@ -19,6 +31,24 @@ trait ResetsPasswords */ public function getEmail() { + return $this->showLinkRequestForm(); + } + + /** + * Display the form to request a password reset link. + * + * @return \Illuminate\Http\Response + */ + public function showLinkRequestForm() + { + if (property_exists($this, 'linkRequestView')) { + return view($this->linkRequestView); + } + + if (view()->exists('auth.passwords.email')) { + return view('auth.passwords.email'); + } + return view('auth.password'); } @@ -30,20 +60,69 @@ public function getEmail() */ public function postEmail(Request $request) { - $this->validate($request, ['email' => 'required|email']); + return $this->sendResetLinkEmail($request); + } - $response = Password::sendResetLink($request->only('email'), function (Message $message) { - $message->subject($this->getEmailSubject()); - }); + /** + * Send a reset link to the given user. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function sendResetLinkEmail(Request $request) + { + $this->validateSendResetLinkEmail($request); + + $broker = $this->getBroker(); + + $response = Password::broker($broker)->sendResetLink( + $this->getSendResetLinkEmailCredentials($request), + $this->resetEmailBuilder() + ); switch ($response) { case Password::RESET_LINK_SENT: - return redirect()->back()->with('status', trans($response)); + return $this->getSendResetLinkEmailSuccessResponse($response); case Password::INVALID_USER: - return redirect()->back()->withErrors(['email' => trans($response)]); + default: + return $this->getSendResetLinkEmailFailureResponse($response); } } + /** + * Validate the request of sending reset link. + * + * @param \Illuminate\Http\Request $request + * @return void + */ + protected function validateSendResetLinkEmail(Request $request) + { + $this->validate($request, ['email' => 'required|email']); + } + + /** + * Get the needed credentials for sending the reset link. + * + * @param \Illuminate\Http\Request $request + * @return array + */ + protected function getSendResetLinkEmailCredentials(Request $request) + { + return $request->only('email'); + } + + /** + * Get the Closure which is used to build the password reset email message. + * + * @return \Closure + */ + protected function resetEmailBuilder() + { + return function (Message $message) { + $message->subject($this->getEmailSubject()); + }; + } + /** * Get the e-mail subject line to be used for the reset link email. * @@ -54,19 +133,68 @@ protected function getEmailSubject() return property_exists($this, 'subject') ? $this->subject : 'Your Password Reset Link'; } + /** + * Get the response for after the reset link has been successfully sent. + * + * @param string $response + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function getSendResetLinkEmailSuccessResponse($response) + { + return redirect()->back()->with('status', trans($response)); + } + + /** + * Get the response for after the reset link could not be sent. + * + * @param string $response + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function getSendResetLinkEmailFailureResponse($response) + { + return redirect()->back()->withErrors(['email' => trans($response)]); + } + + /** + * Display the password reset view for the given token. + * + * If no token is present, display the link request form. + * + * @param \Illuminate\Http\Request $request + * @param string|null $token + * @return \Illuminate\Http\Response + */ + public function getReset(Request $request, $token = null) + { + return $this->showResetForm($request, $token); + } + /** * Display the password reset view for the given token. * - * @param string $token + * If no token is present, display the link request form. + * + * @param \Illuminate\Http\Request $request + * @param string|null $token * @return \Illuminate\Http\Response */ - public function getReset($token = null) + public function showResetForm(Request $request, $token = null) { if (is_null($token)) { - throw new NotFoundHttpException; + return $this->getEmail(); + } + + $email = $request->input('email'); + + if (property_exists($this, 'resetView')) { + return view($this->resetView)->with(compact('token', 'email')); + } + + if (view()->exists('auth.passwords.reset')) { + return view('auth.passwords.reset')->with(compact('token', 'email')); } - return view('auth.reset')->with('token', $token); + return view('auth.reset')->with(compact('token', 'email')); } /** @@ -77,30 +205,87 @@ public function getReset($token = null) */ public function postReset(Request $request) { - $this->validate($request, [ - 'token' => 'required', - 'email' => 'required|email', - 'password' => 'required|confirmed|min:6', - ]); + return $this->reset($request); + } - $credentials = $request->only( - 'email', 'password', 'password_confirmation', 'token' + /** + * Reset the given user's password. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function reset(Request $request) + { + $this->validate( + $request, + $this->getResetValidationRules(), + $this->getResetValidationMessages(), + $this->getResetValidationCustomAttributes() ); - $response = Password::reset($credentials, function ($user, $password) { + $credentials = $this->getResetCredentials($request); + + $broker = $this->getBroker(); + + $response = Password::broker($broker)->reset($credentials, function ($user, $password) { $this->resetPassword($user, $password); }); switch ($response) { case Password::PASSWORD_RESET: - return redirect($this->redirectPath())->with('status', trans($response)); + return $this->getResetSuccessResponse($response); default: - return redirect()->back() - ->withInput($request->only('email')) - ->withErrors(['email' => trans($response)]); + return $this->getResetFailureResponse($request, $response); } } + /** + * Get the password reset validation rules. + * + * @return array + */ + protected function getResetValidationRules() + { + return [ + 'token' => 'required', + 'email' => 'required|email', + 'password' => 'required|confirmed|min:6', + ]; + } + + /** + * Get the password reset validation messages. + * + * @return array + */ + protected function getResetValidationMessages() + { + return []; + } + + /** + * Get the password reset validation custom attributes. + * + * @return array + */ + protected function getResetValidationCustomAttributes() + { + return []; + } + + /** + * Get the password reset credentials from the request. + * + * @param \Illuminate\Http\Request $request + * @return array + */ + protected function getResetCredentials(Request $request) + { + return $request->only( + 'email', 'password', 'password_confirmation', 'token' + ); + } + /** * Reset the given user's password. * @@ -110,10 +295,56 @@ public function postReset(Request $request) */ protected function resetPassword($user, $password) { - $user->password = bcrypt($password); + $user->forceFill([ + 'password' => bcrypt($password), + 'remember_token' => Str::random(60), + ])->save(); + + Auth::guard($this->getGuard())->login($user); + } + + /** + * Get the response for after a successful password reset. + * + * @param string $response + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function getResetSuccessResponse($response) + { + return redirect($this->redirectPath())->with('status', trans($response)); + } - $user->save(); + /** + * Get the response for after a failing password reset. + * + * @param Request $request + * @param string $response + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function getResetFailureResponse(Request $request, $response) + { + return redirect()->back() + ->withInput($request->only('email')) + ->withErrors(['email' => trans($response)]); + } - Auth::login($user); + /** + * Get the broker to be used during password reset. + * + * @return string|null + */ + public function getBroker() + { + return property_exists($this, 'broker') ? $this->broker : null; + } + + /** + * Get the guard to be used during password reset. + * + * @return string|null + */ + protected function getGuard() + { + return property_exists($this, 'guard') ? $this->guard : null; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ThrottlesLogins.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ThrottlesLogins.php index c382ce2..c18e68d 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ThrottlesLogins.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/ThrottlesLogins.php @@ -4,6 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Cache\RateLimiter; +use Illuminate\Auth\Events\Lockout; use Illuminate\Support\Facades\Lang; trait ThrottlesLogins @@ -43,11 +44,10 @@ protected function incrementLoginAttempts(Request $request) */ protected function retriesLeft(Request $request) { - $attempts = app(RateLimiter::class)->attempts( - $this->getThrottleKey($request) + return app(RateLimiter::class)->retriesLeft( + $this->getThrottleKey($request), + $this->maxLoginAttempts() ); - - return $this->maxLoginAttempts() - $attempts + 1; } /** @@ -58,9 +58,7 @@ protected function retriesLeft(Request $request) */ protected function sendLockoutResponse(Request $request) { - $seconds = app(RateLimiter::class)->availableIn( - $this->getThrottleKey($request) - ); + $seconds = $this->secondsRemainingOnLockout($request); return redirect()->back() ->withInput($request->only($this->loginUsername(), 'remember')) @@ -82,6 +80,19 @@ protected function getLockoutErrorMessage($seconds) : 'Too many login attempts. Please try again in '.$seconds.' seconds.'; } + /** + * Get the lockout seconds. + * + * @param \Illuminate\Http\Request $request + * @return int + */ + protected function secondsRemainingOnLockout(Request $request) + { + return app(RateLimiter::class)->availableIn( + $this->getThrottleKey($request) + ); + } + /** * Clear the login locks for the given user credentials. * @@ -125,4 +136,15 @@ protected function lockoutTime() { return property_exists($this, 'lockoutTime') ? $this->lockoutTime : 60; } + + /** + * Fire an event when a lockout occurs. + * + * @param \Illuminate\Http\Request $request + * @return void + */ + protected function fireLockoutEvent(Request $request) + { + event(new Lockout($request)); + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php new file mode 100644 index 0000000..5c84778 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php @@ -0,0 +1,19 @@ +useFiles($app->storagePath().'/logs/laravel.log'); + $log->useFiles( + $app->storagePath().'/logs/laravel.log', + $app->make('config')->get('app.log_level', 'debug') + ); } /** @@ -80,9 +83,13 @@ protected function configureSingleHandler(Application $app, Writer $log) */ protected function configureDailyHandler(Application $app, Writer $log) { + $config = $app->make('config'); + + $maxFiles = $config->get('app.log_max_files'); + $log->useDailyFiles( - $app->storagePath().'/logs/laravel.log', - $app->make('config')->get('app.log_max_files', 5) + $app->storagePath().'/logs/laravel.log', is_null($maxFiles) ? 5 : $maxFiles, + $config->get('app.log_level', 'debug') ); } @@ -95,7 +102,10 @@ protected function configureDailyHandler(Application $app, Writer $log) */ protected function configureSyslogHandler(Application $app, Writer $log) { - $log->useSyslog('laravel'); + $log->useSyslog( + 'laravel', + $app->make('config')->get('app.log_level', 'debug') + ); } /** @@ -107,6 +117,6 @@ protected function configureSyslogHandler(Application $app, Writer $log) */ protected function configureErrorlogHandler(Application $app, Writer $log) { - $log->useErrorLog(); + $log->useErrorLog($app->make('config')->get('app.log_level', 'debug')); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php index 4b44440..0391473 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php @@ -2,8 +2,8 @@ namespace Illuminate\Foundation\Bootstrap; -use Dotenv; -use InvalidArgumentException; +use Dotenv\Dotenv; +use Dotenv\Exception\InvalidPathException; use Illuminate\Contracts\Foundation\Application; class DetectEnvironment @@ -16,14 +16,33 @@ class DetectEnvironment */ public function bootstrap(Application $app) { - try { - Dotenv::load($app->environmentPath(), $app->environmentFile()); - } catch (InvalidArgumentException $e) { - // + if (! $app->configurationIsCached()) { + $this->checkForSpecificEnvironmentFile($app); + + try { + (new Dotenv($app->environmentPath(), $app->environmentFile()))->load(); + } catch (InvalidPathException $e) { + // + } + } + } + + /** + * Detect if a custom environment file matching the APP_ENV exists. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return void + */ + protected function checkForSpecificEnvironmentFile($app) + { + if (! env('APP_ENV')) { + return; } - $app->detectEnvironment(function () { - return env('APP_ENV', 'production'); - }); + $file = $app->environmentFile().'.'.env('APP_ENV'); + + if (file_exists($app->environmentPath().'/'.$file)) { + $app->loadEnvironmentFrom($file); + } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php index 4974e5c..0730372 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php @@ -91,7 +91,7 @@ public function handleException($e) * @param \Exception $e * @return void */ - protected function renderForConsole($e) + protected function renderForConsole(Exception $e) { $this->getExceptionHandler()->renderForConsole(new ConsoleOutput, $e); } @@ -102,7 +102,7 @@ protected function renderForConsole($e) * @param \Exception $e * @return void */ - protected function renderHttpResponse($e) + protected function renderHttpResponse(Exception $e) { $this->getExceptionHandler()->render($this->app['request'], $e)->send(); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php index 9f1c731..eb4d076 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php @@ -38,6 +38,10 @@ public function bootstrap(Application $app) $this->loadConfigurationFiles($app, $config); } + $app->detectEnvironment(function () use ($config) { + return $config->get('app.env', 'production'); + }); + date_default_timezone_set($config['app.timezone']); mb_internal_encoding('UTF-8'); diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php index 7db2174..86816b2 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php @@ -2,8 +2,8 @@ namespace Illuminate\Foundation\Bootstrap; -use Illuminate\Foundation\AliasLoader; use Illuminate\Support\Facades\Facade; +use Illuminate\Foundation\AliasLoader; use Illuminate\Contracts\Foundation\Application; class RegisterFacades diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesCommands.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesCommands.php deleted file mode 100644 index cc6678c..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesCommands.php +++ /dev/null @@ -1,11 +0,0 @@ -dispatch($job); + return app(Dispatcher::class)->dispatch($job); } /** - * Marshal a job and dispatch it to its appropriate handler. + * Dispatch a command to its appropriate handler in the current process. * * @param mixed $job - * @param array $array * @return mixed */ - protected function dispatchFromArray($job, array $array) + public function dispatchNow($job) { - return app('Illuminate\Contracts\Bus\Dispatcher')->dispatchFromArray($job, $array); - } - - /** - * Marshal a job and dispatch it to its appropriate handler. - * - * @param mixed $job - * @param \ArrayAccess $source - * @param array $extras - * @return mixed - */ - protected function dispatchFrom($job, ArrayAccess $source, $extras = []) - { - return app('Illuminate\Contracts\Bus\Dispatcher')->dispatchFrom($job, $source, $extras); + return app(Dispatcher::class)->dispatchNow($job); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php index 99a2798..1111475 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php @@ -3,7 +3,7 @@ namespace Illuminate\Foundation\Console; use Illuminate\Console\Command; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Symfony\Component\Finder\Finder; use Illuminate\Filesystem\Filesystem; use Symfony\Component\Console\Input\InputArgument; @@ -27,7 +27,7 @@ class AppNameCommand extends Command /** * The Composer class instance. * - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -48,7 +48,7 @@ class AppNameCommand extends Command /** * Create a new key generator command. * - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @param \Illuminate\Filesystem\Filesystem $files * @return void */ @@ -79,8 +79,6 @@ public function fire() $this->setDatabaseFactoryNamespaces(); - $this->setPhpSpecNamespace(); - $this->info('Application namespace set!'); $this->composer->dumpAutoloads(); @@ -97,6 +95,7 @@ protected function setAppDirectoryNamespace() { $files = Finder::create() ->in($this->laravel['path']) + ->contains($this->currentRoot) ->name('*.php'); foreach ($files as $file) { @@ -201,7 +200,7 @@ protected function setAppConfigNamespaces() protected function setAuthConfigNamespace() { $this->replaceIn( - $this->getAuthConfigPath(), $this->currentRoot.'\\User', $this->argument('name').'\\User' + $this->getConfigPath('auth'), $this->currentRoot.'\\User', $this->argument('name').'\\User' ); } @@ -213,22 +212,10 @@ protected function setAuthConfigNamespace() protected function setServicesConfigNamespace() { $this->replaceIn( - $this->getServicesConfigPath(), $this->currentRoot.'\\User', $this->argument('name').'\\User' + $this->getConfigPath('services'), $this->currentRoot.'\\User', $this->argument('name').'\\User' ); } - /** - * Set the PHPSpec configuration namespace. - * - * @return void - */ - protected function setPhpSpecNamespace() - { - if ($this->files->exists($path = $this->getPhpSpecConfigPath())) { - $this->replaceIn($path, $this->currentRoot, $this->argument('name')); - } - } - /** * Set the namespace in database factory files. * @@ -261,7 +248,7 @@ protected function replaceIn($path, $search, $replace) */ protected function getBootstrapPath() { - return $this->laravel->basePath().'/bootstrap/app.php'; + return $this->laravel->bootstrapPath().'/app.php'; } /** @@ -285,36 +272,6 @@ protected function getConfigPath($name) return $this->laravel['path.config'].'/'.$name.'.php'; } - /** - * Get the path to the authentication configuration file. - * - * @return string - */ - protected function getAuthConfigPath() - { - return $this->getConfigPath('auth'); - } - - /** - * Get the path to the services configuration file. - * - * @return string - */ - protected function getServicesConfigPath() - { - return $this->getConfigPath('services'); - } - - /** - * Get the path to the PHPSpec configuration file. - * - * @return string - */ - protected function getPhpSpecConfigPath() - { - return $this->laravel->basePath().'/phpspec.yml'; - } - /** * Get the console command arguments. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/CommandMakeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/CommandMakeCommand.php deleted file mode 100644 index d009dc2..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/CommandMakeCommand.php +++ /dev/null @@ -1,90 +0,0 @@ -option('handler')) { - $this->call('handler:command', [ - 'name' => $this->argument('name').'Handler', - '--command' => $this->parseName($this->argument('name')), - ]); - } - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - if ($this->option('queued') && $this->option('handler')) { - return __DIR__.'/stubs/command-queued-with-handler.stub'; - } elseif ($this->option('queued')) { - return __DIR__.'/stubs/command-queued.stub'; - } elseif ($this->option('handler')) { - return __DIR__.'/stubs/command-with-handler.stub'; - } else { - return __DIR__.'/stubs/command.stub'; - } - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Commands'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['handler', null, InputOption::VALUE_NONE, 'Indicates that handler class should be generated.'], - - ['queued', null, InputOption::VALUE_NONE, 'Indicates that command should be queued.'], - ]; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php index 2152cfa..63c458b 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php @@ -66,7 +66,7 @@ public function fire() */ protected function getFreshConfiguration() { - $app = require $this->laravel->basePath().'/bootstrap/app.php'; + $app = require $this->laravel->bootstrapPath().'/app.php'; $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/HandlerCommandCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/HandlerCommandCommand.php deleted file mode 100644 index 33de193..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/HandlerCommandCommand.php +++ /dev/null @@ -1,84 +0,0 @@ -option('command')), $stub - ); - - $stub = str_replace( - 'DummyFullCommand', $this->option('command'), $stub - ); - - return $stub; - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return __DIR__.'/stubs/command-handler.stub'; - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Handlers\Commands'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['command', null, InputOption::VALUE_REQUIRED, 'The command class the handler handles.'], - ]; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/HandlerEventCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/HandlerEventCommand.php deleted file mode 100644 index 341ffe0..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/HandlerEventCommand.php +++ /dev/null @@ -1,97 +0,0 @@ -option('event'); - - if (! Str::startsWith($event, $this->laravel->getNamespace())) { - $event = $this->laravel->getNamespace().'Events\\'.$event; - } - - $stub = str_replace( - 'DummyEvent', class_basename($event), $stub - ); - - $stub = str_replace( - 'DummyFullEvent', $event, $stub - ); - - return $stub; - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - if ($this->option('queued')) { - return __DIR__.'/stubs/event-handler-queued.stub'; - } else { - return __DIR__.'/stubs/event-handler.stub'; - } - } - - /** - * Get the default namespace for the class. - * - * @param string $rootNamespace - * @return string - */ - protected function getDefaultNamespace($rootNamespace) - { - return $rootNamespace.'\Handlers\Events'; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['event', null, InputOption::VALUE_REQUIRED, 'The event class the handler handles.'], - - ['queued', null, InputOption::VALUE_NONE, 'Indicates the event handler should be queued.'], - ]; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/IlluminateCaster.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/IlluminateCaster.php index e555c82..3db75e6 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/IlluminateCaster.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/IlluminateCaster.php @@ -30,6 +30,7 @@ class IlluminateCaster 'langPath', 'publicPath', 'storagePath', + 'bootstrapPath', ]; /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php index 8e1aeee..e7fd2ec 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/JobMakeCommand.php @@ -35,10 +35,10 @@ class JobMakeCommand extends GeneratorCommand */ protected function getStub() { - if ($this->option('queued')) { - return __DIR__.'/stubs/job-queued.stub'; - } else { + if ($this->option('sync')) { return __DIR__.'/stubs/job.stub'; + } else { + return __DIR__.'/stubs/job-queued.stub'; } } @@ -61,7 +61,7 @@ protected function getDefaultNamespace($rootNamespace) protected function getOptions() { return [ - ['queued', null, InputOption::VALUE_NONE, 'Indicates that job should be queued.'], + ['sync', null, InputOption::VALUE_NONE, 'Indicates that job should be synchronous.'], ]; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php index 991588f..6d89f2f 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php @@ -4,8 +4,8 @@ use Exception; use Throwable; -use Illuminate\Console\Scheduling\Schedule; use Illuminate\Contracts\Events\Dispatcher; +use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Application as Artisan; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Console\Kernel as KernelContract; @@ -145,6 +145,17 @@ protected function schedule(Schedule $schedule) // } + /** + * Register the given command with the console application. + * + * @param \Symfony\Component\Console\Command\Command $command + * @return void + */ + public function registerCommand($command) + { + $this->getArtisan()->add($command); + } + /** * Run an Artisan console command by name. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php index 12d8bc9..f30fffb 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php @@ -2,18 +2,16 @@ namespace Illuminate\Foundation\Console; -use Illuminate\Support\Str; use Illuminate\Console\Command; -use Symfony\Component\Console\Input\InputOption; class KeyGenerateCommand extends Command { /** - * The console command name. + * The name and signature of the console command. * * @var string */ - protected $name = 'key:generate'; + protected $signature = 'key:generate {--show : Display the key instead of modifying files}'; /** * The console command description. @@ -29,19 +27,16 @@ class KeyGenerateCommand extends Command */ public function fire() { - $key = $this->getRandomKey($this->laravel['config']['app.cipher']); + $key = $this->generateRandomKey(); if ($this->option('show')) { return $this->line(''.$key.''); } - $path = base_path('.env'); - - if (file_exists($path)) { - file_put_contents($path, str_replace( - 'APP_KEY='.$this->laravel['config']['app.key'], 'APP_KEY='.$key, file_get_contents($path) - )); - } + // Next, we will replace the application key in the environment file so it is + // automatically setup for this developer. This key gets generated using a + // secure random byte generator and is later base64 encoded for storage. + $this->setKeyInEnvironmentFile($key); $this->laravel['config']['app.key'] = $key; @@ -49,29 +44,29 @@ public function fire() } /** - * Generate a random key for the application. + * Set the application key in the environment file. * - * @param string $cipher - * @return string + * @param string $key + * @return void */ - protected function getRandomKey($cipher) + protected function setKeyInEnvironmentFile($key) { - if ($cipher === 'AES-128-CBC') { - return Str::random(16); - } - - return Str::random(32); + file_put_contents($this->laravel->environmentFilePath(), str_replace( + 'APP_KEY='.$this->laravel['config']['app.key'], + 'APP_KEY='.$key, + file_get_contents($this->laravel->environmentFilePath()) + )); } /** - * Get the console command options. + * Generate a random key for the application. * - * @return array + * @return string */ - protected function getOptions() + protected function generateRandomKey() { - return [ - ['show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'], - ]; + return 'base64:'.base64_encode(random_bytes( + $this->laravel['config']['app.cipher'] == 'AES-128-CBC' ? 16 : 32 + )); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php index 62861df..2609067 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeCommand.php @@ -55,7 +55,7 @@ protected function buildClass($name) $event = $this->option('event'); - if (! Str::startsWith($event, $this->laravel->getNamespace())) { + if (! Str::startsWith($event, $this->laravel->getNamespace()) && ! Str::startsWith($event, 'Illuminate')) { $event = $this->laravel->getNamespace().'Events\\'.$event; } @@ -84,6 +84,17 @@ protected function getStub() } } + /** + * Determine if the class already exists. + * + * @param string $rawName + * @return bool + */ + protected function alreadyExists($rawName) + { + return class_exists($rawName); + } + /** * Get the default namespace for the class. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Optimize/config.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Optimize/config.php index 1f024e0..ec44a62 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Optimize/config.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/Optimize/config.php @@ -8,7 +8,6 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Foundation/Application.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Bus/Dispatcher.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Bus/QueueingDispatcher.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Bus/HandlerResolver.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Pipeline/Pipeline.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Support/Renderable.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Logging/Log.php', @@ -32,10 +31,11 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/View/View.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Http/Kernel.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Guard.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Auth/StatefulGuard.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Auth/Access/Gate.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Hashing/Hasher.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/Guard.php', + $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/SessionGuard.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Contracts/Auth/UserProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php', @@ -76,7 +76,6 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Support/AggregateServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Events/EventServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php', @@ -85,7 +84,6 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Bus/DispatchesJobs.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Auth/AuthServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/AuthServiceProvider.php', @@ -124,7 +122,6 @@ $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/ControllerInspector.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php', - $basePath.'/vendor/laravel/framework/src/Illuminate/Bus/BusServiceProvider.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php', $basePath.'/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterface.php', @@ -183,10 +180,6 @@ $basePath.'/vendor/symfony/http-foundation/ResponseHeaderBag.php', $basePath.'/vendor/symfony/http-foundation/Cookie.php', $basePath.'/vendor/symfony/finder/SplFileInfo.php', - $basePath.'/vendor/symfony/finder/Expression/Glob.php', - $basePath.'/vendor/symfony/finder/Expression/Regex.php', - $basePath.'/vendor/symfony/finder/Expression/ValueInterface.php', - $basePath.'/vendor/symfony/finder/Expression/Expression.php', $basePath.'/vendor/symfony/finder/Iterator/FilterIterator.php', $basePath.'/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php', $basePath.'/vendor/symfony/finder/Iterator/PathFilterIterator.php', @@ -194,13 +187,6 @@ $basePath.'/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php', $basePath.'/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php', $basePath.'/vendor/symfony/finder/Iterator/FilenameFilterIterator.php', - $basePath.'/vendor/symfony/finder/Shell/Shell.php', - $basePath.'/vendor/symfony/finder/Adapter/AdapterInterface.php', - $basePath.'/vendor/symfony/finder/Adapter/AbstractAdapter.php', - $basePath.'/vendor/symfony/finder/Adapter/AbstractFindAdapter.php', - $basePath.'/vendor/symfony/finder/Adapter/GnuFindAdapter.php', - $basePath.'/vendor/symfony/finder/Adapter/PhpAdapter.php', - $basePath.'/vendor/symfony/finder/Adapter/BsdFindAdapter.php', $basePath.'/vendor/symfony/finder/Finder.php', $basePath.'/vendor/symfony/finder/Glob.php', $basePath.'/vendor/vlucas/phpdotenv/src/Dotenv.php', diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php index 4c74313..61928ed 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php @@ -2,18 +2,10 @@ namespace Illuminate\Foundation\Console; -use PhpParser\Lexer; -use PhpParser\Parser; use ClassPreloader\Factory; use Illuminate\Console\Command; -use ClassPreloader\ClassPreloader; -use Illuminate\Foundation\Composer; -use ClassPreloader\Parser\DirVisitor; -use ClassPreloader\Parser\FileVisitor; -use ClassPreloader\Parser\NodeTraverser; -use ClassPreloader\Exceptions\SkipFileException; +use Illuminate\Support\Composer; use Symfony\Component\Console\Input\InputOption; -use PhpParser\PrettyPrinter\Standard as PrettyPrinter; use ClassPreloader\Exceptions\VisitorExceptionInterface; class OptimizeCommand extends Command @@ -35,14 +27,14 @@ class OptimizeCommand extends Command /** * The composer instance. * - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; /** * Create a new optimize command instance. * - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(Composer $composer) @@ -82,57 +74,21 @@ public function fire() */ protected function compileClasses() { - $preloader = $this->getClassPreloader(); + $preloader = (new Factory)->create(['skip' => true]); $handle = $preloader->prepareOutput($this->laravel->getCachedCompilePath()); foreach ($this->getClassFiles() as $file) { try { fwrite($handle, $preloader->getCode($file, false)."\n"); - } catch (SkipFileException $ex) { - // Class Preloader 2.x } catch (VisitorExceptionInterface $e) { - // Class Preloader 3.x + // } } fclose($handle); } - /** - * Get the class preloader used by the command. - * - * @return \ClassPreloader\ClassPreloader - */ - protected function getClassPreloader() - { - // Class Preloader 3.x - if (class_exists(Factory::class)) { - return (new Factory)->create(['skip' => true]); - } - - // Class Preloader 2.x - return new ClassPreloader(new PrettyPrinter, new Parser(new Lexer), $this->getTraverser()); - } - - /** - * Get the node traverser used by the command. - * - * Note that this method is only called if we're using Class Preloader 2.x. - * - * @return \ClassPreloader\Parser\NodeTraverser - */ - protected function getTraverser() - { - $traverser = new NodeTraverser; - - $traverser->addVisitor(new DirVisitor(true)); - - $traverser->addVisitor(new FileVisitor(true)); - - return $traverser; - } - /** * Get the classes that should be combined and compiled. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php index 65540bc..148c3e5 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php @@ -75,7 +75,7 @@ public function fire() */ protected function getFreshApplicationRoutes() { - $app = require $this->laravel->basePath().'/bootstrap/app.php'; + $app = require $this->laravel->bootstrapPath().'/app.php'; $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php index 463f3ab..d06db10 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php @@ -4,7 +4,6 @@ use Illuminate\Support\Arr; use Illuminate\Support\Str; -use Illuminate\Http\Request; use Illuminate\Routing\Route; use Illuminate\Routing\Router; use Illuminate\Console\Command; @@ -141,10 +140,6 @@ protected function getMiddleware($route) { $middlewares = array_values($route->middleware()); - $middlewares = array_unique( - array_merge($middlewares, $this->getPatternFilters($route)) - ); - $actionName = $route->getActionName(); if (! empty($actionName) && $actionName !== 'Closure') { @@ -206,42 +201,6 @@ protected function methodExcludedByOptions($method, array $options) (! empty($options['except']) && in_array($method, (array) $options['except'])); } - /** - * Get all of the pattern filters matching the route. - * - * @param \Illuminate\Routing\Route $route - * @return array - */ - protected function getPatternFilters($route) - { - $patterns = []; - - foreach ($route->methods() as $method) { - // For each method supported by the route we will need to gather up the patterned - // filters for that method. We will then merge these in with the other filters - // we have already gathered up then return them back out to these consumers. - $inner = $this->getMethodPatterns($route->uri(), $method); - - $patterns = array_merge($patterns, array_keys($inner)); - } - - return $patterns; - } - - /** - * Get the pattern filters for a given URI and method. - * - * @param string $uri - * @param string $method - * @return array - */ - protected function getMethodPatterns($uri, $method) - { - return $this->router->findPatternFilters( - Request::create($uri, $method) - ); - } - /** * Filter the route by URI and / or name. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php index 2bb2990..1550ef0 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php @@ -58,7 +58,7 @@ public function fire() $tags = $tags ?: [null]; - foreach ($tags as $tag) { + foreach ((array) $tags as $tag) { $this->publishTag($tag); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/command-handler.stub b/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/command-handler.stub deleted file mode 100644 index 8fdf3ee..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/command-handler.stub +++ /dev/null @@ -1,30 +0,0 @@ -dontReport as $type) { + $dontReport = array_merge($this->dontReport, [HttpResponseException::class]); + + foreach ($dontReport as $type) { if ($e instanceof $type) { return true; } @@ -84,12 +93,20 @@ protected function shouldntReport(Exception $e) * * @param \Illuminate\Http\Request $request * @param \Exception $e - * @return \Illuminate\Http\Response + * @return \Symfony\Component\HttpFoundation\Response */ public function render($request, Exception $e) { - if ($this->isUnauthorizedException($e)) { + if ($e instanceof HttpResponseException) { + return $e->getResponse(); + } elseif ($e instanceof ModelNotFoundException) { + $e = new NotFoundHttpException($e->getMessage(), $e); + } elseif ($e instanceof AuthenticationException) { + return $this->unauthenticated($request, $e); + } elseif ($e instanceof AuthorizationException) { $e = new HttpException(403, $e->getMessage()); + } elseif ($e instanceof ValidationException && $e->getResponse()) { + return $e->getResponse(); } if ($this->isHttpException($e)) { @@ -110,9 +127,7 @@ protected function toIlluminateResponse($response, Exception $e) { $response = new Response($response->getContent(), $response->getStatusCode(), $response->headers->all()); - $response->exception = $e; - - return $response; + return $response->withException($e); } /** @@ -138,32 +153,73 @@ protected function renderHttpException(HttpException $e) $status = $e->getStatusCode(); if (view()->exists("errors.{$status}")) { - return response()->view("errors.{$status}", ['exception' => $e], $status); + return response()->view("errors.{$status}", ['exception' => $e], $status, $e->getHeaders()); } else { return $this->convertExceptionToResponse($e); } } /** - * Convert the given exception into a Response instance. + * Create a Symfony response for the given exception. * * @param \Exception $e * @return \Symfony\Component\HttpFoundation\Response */ protected function convertExceptionToResponse(Exception $e) { - return (new SymfonyDisplayer(config('app.debug')))->createResponse($e); + $e = FlattenException::create($e); + + $handler = new SymfonyExceptionHandler(config('app.debug')); + + $decorated = $this->decorate($handler->getContent($e), $handler->getStylesheet($e)); + + return SymfonyResponse::create($decorated, $e->getStatusCode(), $e->getHeaders()); } /** - * Determine if the given exception is an access unauthorized exception. + * Convert an authentication exception into an unauthenticated response. * - * @param \Exception $e - * @return bool + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Auth\AuthenticationException $e + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function unauthenticated($request, AuthenticationException $e) + { + if ($request->ajax() || $request->wantsJson()) { + return response('Unauthorized.', 401); + } else { + return redirect()->guest('login'); + } + } + + /** + * Get the html response content. + * + * @param string $content + * @param string $css + * @return string */ - protected function isUnauthorizedException(Exception $e) + protected function decorate($content, $css) { - return $e instanceof UnauthorizedException; + return << + + + + + + + $content + + +EOF; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php index e390609..9289506 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php @@ -80,15 +80,27 @@ protected function getValidatorInstance() } return $factory->make( - $this->all(), $this->container->call([$this, 'rules']), $this->messages(), $this->attributes() + $this->validationData(), $this->container->call([$this, 'rules']), $this->messages(), $this->attributes() ); } + /** + * Get data to be validated from the request. + * + * @return array + */ + protected function validationData() + { + return $this->all(); + } + /** * Handle a failed validation attempt. * * @param \Illuminate\Contracts\Validation\Validator $validator - * @return mixed + * @return void + * + * @throws \Illuminate\Http\Exception\HttpResponseException */ protected function failedValidation(Validator $validator) { @@ -114,7 +126,9 @@ protected function passesAuthorization() /** * Handle a failed authorization attempt. * - * @return mixed + * @return void + * + * @throws \Illuminate\Http\Exception\HttpResponseException */ protected function failedAuthorization() { @@ -129,7 +143,7 @@ protected function failedAuthorization() */ public function response(array $errors) { - if ($this->ajax() || $this->wantsJson()) { + if (($this->ajax() && ! $this->pjax()) || $this->wantsJson()) { return new JsonResponse($errors, 422); } @@ -183,7 +197,7 @@ protected function getRedirectUrl() * Set the Redirector instance. * * @param \Illuminate\Routing\Redirector $redirector - * @return \Illuminate\Foundation\Http\FormRequest + * @return $this */ public function setRedirector(Redirector $redirector) { @@ -206,7 +220,7 @@ public function setContainer(Container $container) } /** - * Set custom messages for validator errors. + * Get custom messages for validator errors. * * @return array */ @@ -216,7 +230,7 @@ public function messages() } /** - * Set custom attributes for validator errors. + * Get custom attributes for validator errors. * * @return array */ diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php index f18e020..4cf145b 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php @@ -5,9 +5,10 @@ use Exception; use Throwable; use Illuminate\Routing\Router; -use Illuminate\Pipeline\Pipeline; +use Illuminate\Routing\Pipeline; use Illuminate\Support\Facades\Facade; use Illuminate\Contracts\Foundation\Application; +use Illuminate\Contracts\Debug\ExceptionHandler; use Illuminate\Contracts\Http\Kernel as KernelContract; use Symfony\Component\Debug\Exception\FatalThrowableError; @@ -49,6 +50,13 @@ class Kernel implements KernelContract */ protected $middleware = []; + /** + * The application's route middleware groups. + * + * @var array + */ + protected $middlewareGroups = []; + /** * The application's route middleware. * @@ -68,6 +76,10 @@ public function __construct(Application $app, Router $router) $this->app = $app; $this->router = $router; + foreach ($this->middlewareGroups as $key => $middleware) { + $router->middlewareGroup($key, $middleware); + } + foreach ($this->routeMiddleware as $key => $middleware) { $router->middleware($key, $middleware); } @@ -90,9 +102,7 @@ public function handle($request) $response = $this->renderException($request, $e); } catch (Throwable $e) { - $e = new FatalThrowableError($e); - - $this->reportException($e); + $this->reportException($e = new FatalThrowableError($e)); $response = $this->renderException($request, $e); } @@ -266,7 +276,7 @@ protected function bootstrappers() */ protected function reportException(Exception $e) { - $this->app['Illuminate\Contracts\Debug\ExceptionHandler']->report($e); + $this->app[ExceptionHandler::class]->report($e); } /** @@ -278,7 +288,7 @@ protected function reportException(Exception $e) */ protected function renderException($request, Exception $e) { - return $this->app['Illuminate\Contracts\Debug\ExceptionHandler']->render($request, $e); + return $this->app[ExceptionHandler::class]->render($request, $e); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/Authorize.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/Authorize.php new file mode 100644 index 0000000..cad2661 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/Authorize.php @@ -0,0 +1,68 @@ +gate = $gate; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string $ability + * @param string|null $model + * @return mixed + * + * @throws \Illuminate\Auth\Access\AuthorizationException + */ + public function handle($request, Closure $next, $ability, $model = null) + { + $this->gate->authorize($ability, $this->getGateArguments($request, $model)); + + return $next($request); + } + + /** + * Get the arguments parameter for the gate. + * + * @param \Illuminate\Http\Request $request + * @param string|null $model + * @return array|string|\Illuminate\Database\Eloquent\Model + */ + protected function getGateArguments($request, $model) + { + // If there's no model, we'll pass an empty array to the gate. If it + // looks like a FQCN of a model, we'll send it to the gate as is. + // Otherwise, we'll resolve the Eloquent model from the route. + if (is_null($model)) { + return []; + } + + if (strpos($model, '\\') !== false) { + return $model; + } + + return $request->route($model); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php index 9caf7fc..828399d 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php @@ -3,13 +3,20 @@ namespace Illuminate\Foundation\Http\Middleware; use Closure; -use Illuminate\Support\Str; +use Illuminate\Foundation\Application; use Symfony\Component\HttpFoundation\Cookie; use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Session\TokenMismatchException; class VerifyCsrfToken { + /** + * The application instance. + * + * @var \Illuminate\Foundation\Application + */ + protected $app; + /** * The encrypter implementation. * @@ -27,11 +34,13 @@ class VerifyCsrfToken /** * Create a new middleware instance. * + * @param \Illuminate\Foundation\Application $app * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter * @return void */ - public function __construct(Encrypter $encrypter) + public function __construct(Application $app, Encrypter $encrypter) { + $this->app = $app; $this->encrypter = $encrypter; } @@ -46,7 +55,12 @@ public function __construct(Encrypter $encrypter) */ public function handle($request, Closure $next) { - if ($this->isReading($request) || $this->shouldPassThrough($request) || $this->tokensMatch($request)) { + if ( + $this->isReading($request) || + $this->runningUnitTests() || + $this->shouldPassThrough($request) || + $this->tokensMatch($request) + ) { return $this->addCookieToResponse($request, $next($request)); } @@ -74,6 +88,16 @@ protected function shouldPassThrough($request) return false; } + /** + * Determine if the application is running unit tests. + * + * @return bool + */ + protected function runningUnitTests() + { + return $this->app->runningInConsole() && $this->app->runningUnitTests(); + } + /** * Determine if the session and input CSRF tokens match. * @@ -94,7 +118,7 @@ protected function tokensMatch($request) return false; } - return Str::equals($sessionToken, $token); + return hash_equals($sessionToken, $token); } /** @@ -110,7 +134,7 @@ protected function addCookieToResponse($request, $response) $response->headers->setCookie( new Cookie( - 'XSRF-TOKEN', $request->session()->token(), time() + 60 * 120, + 'XSRF-TOKEN', $request->session()->token(), time() + 60 * $config['lifetime'], $config['path'], $config['domain'], $config['secure'], false ) ); diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyPostSize.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyPostSize.php index a3e0f55..692c001 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyPostSize.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyPostSize.php @@ -32,20 +32,21 @@ public function handle($request, Closure $next) */ protected function getPostMaxSize() { - $postMaxSize = ini_get('post_max_size'); + if (is_numeric($postMaxSize = ini_get('post_max_size'))) { + return (int) $postMaxSize; + } - switch (substr($postMaxSize, -1)) { - case 'M': - case 'm': - return (int) $postMaxSize * 1048576; + $metric = strtoupper(substr($postMaxSize, -1)); + + switch ($metric) { case 'K': - case 'k': return (int) $postMaxSize * 1024; + case 'M': + return (int) $postMaxSize * 1048576; case 'G': - case 'g': return (int) $postMaxSize * 1073741824; + default: + return (int) $postMaxSize; } - - return (int) $postMaxSize; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php old mode 100644 new mode 100755 index 6048de8..f63733b --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php @@ -169,7 +169,7 @@ public function loadManifest() // service provided by the application and whether its provider is using // deferred loading or should be eagerly loaded on each request to us. if ($this->files->exists($this->manifestPath)) { - $manifest = json_decode($this->files->get($this->manifestPath), true); + $manifest = $this->files->getRequire($this->manifestPath); if ($manifest) { return array_merge(['when' => []], $manifest); @@ -186,7 +186,7 @@ public function loadManifest() public function writeManifest($manifest) { $this->files->put( - $this->manifestPath, json_encode($manifest, JSON_PRETTY_PRINT) + $this->manifestPath, ' []], $manifest); diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php old mode 100644 new mode 100755 index f74448d..98a7a95 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php @@ -3,35 +3,41 @@ namespace Illuminate\Foundation\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Queue\Console\TableCommand; +use Illuminate\Auth\Console\MakeAuthCommand; use Illuminate\Foundation\Console\UpCommand; use Illuminate\Foundation\Console\DownCommand; +use Illuminate\Auth\Console\ClearResetsCommand; use Illuminate\Foundation\Console\ServeCommand; +use Illuminate\Cache\Console\CacheTableCommand; +use Illuminate\Queue\Console\FailedTableCommand; use Illuminate\Foundation\Console\TinkerCommand; -use Illuminate\Foundation\Console\AppNameCommand; use Illuminate\Foundation\Console\JobMakeCommand; +use Illuminate\Foundation\Console\AppNameCommand; use Illuminate\Foundation\Console\OptimizeCommand; use Illuminate\Foundation\Console\TestMakeCommand; +use Illuminate\Foundation\Console\RouteListCommand; use Illuminate\Foundation\Console\EventMakeCommand; use Illuminate\Foundation\Console\ModelMakeCommand; -use Illuminate\Foundation\Console\RouteListCommand; use Illuminate\Foundation\Console\ViewClearCommand; +use Illuminate\Session\Console\SessionTableCommand; use Illuminate\Foundation\Console\PolicyMakeCommand; use Illuminate\Foundation\Console\RouteCacheCommand; use Illuminate\Foundation\Console\RouteClearCommand; -use Illuminate\Foundation\Console\CommandMakeCommand; +use Illuminate\Routing\Console\ControllerMakeCommand; +use Illuminate\Routing\Console\MiddlewareMakeCommand; use Illuminate\Foundation\Console\ConfigCacheCommand; use Illuminate\Foundation\Console\ConfigClearCommand; use Illuminate\Foundation\Console\ConsoleMakeCommand; use Illuminate\Foundation\Console\EnvironmentCommand; use Illuminate\Foundation\Console\KeyGenerateCommand; use Illuminate\Foundation\Console\RequestMakeCommand; -use Illuminate\Foundation\Console\HandlerEventCommand; use Illuminate\Foundation\Console\ListenerMakeCommand; use Illuminate\Foundation\Console\ProviderMakeCommand; use Illuminate\Foundation\Console\ClearCompiledCommand; use Illuminate\Foundation\Console\EventGenerateCommand; use Illuminate\Foundation\Console\VendorPublishCommand; -use Illuminate\Foundation\Console\HandlerCommandCommand; +use Illuminate\Database\Console\Seeds\SeederMakeCommand; class ArtisanServiceProvider extends ServiceProvider { @@ -48,35 +54,49 @@ class ArtisanServiceProvider extends ServiceProvider * @var array */ protected $commands = [ - 'AppName' => 'command.app.name', 'ClearCompiled' => 'command.clear-compiled', - 'CommandMake' => 'command.command.make', + 'ClearResets' => 'command.auth.resets.clear', 'ConfigCache' => 'command.config.cache', 'ConfigClear' => 'command.config.clear', + 'Down' => 'command.down', + 'Environment' => 'command.environment', + 'KeyGenerate' => 'command.key.generate', + 'Optimize' => 'command.optimize', + 'RouteCache' => 'command.route.cache', + 'RouteClear' => 'command.route.clear', + 'RouteList' => 'command.route.list', + 'Tinker' => 'command.tinker', + 'Up' => 'command.up', + 'ViewClear' => 'command.view.clear', + ]; + + /** + * The commands to be registered. + * + * @var array + */ + protected $devCommands = [ + 'AppName' => 'command.app.name', + 'AuthMake' => 'command.auth.make', + 'CacheTable' => 'command.cache.table', 'ConsoleMake' => 'command.console.make', + 'ControllerMake' => 'command.controller.make', 'EventGenerate' => 'command.event.generate', 'EventMake' => 'command.event.make', - 'Down' => 'command.down', - 'Environment' => 'command.environment', - 'HandlerCommand' => 'command.handler.command', - 'HandlerEvent' => 'command.handler.event', 'JobMake' => 'command.job.make', - 'KeyGenerate' => 'command.key.generate', 'ListenerMake' => 'command.listener.make', + 'MiddlewareMake' => 'command.middleware.make', 'ModelMake' => 'command.model.make', - 'Optimize' => 'command.optimize', 'PolicyMake' => 'command.policy.make', 'ProviderMake' => 'command.provider.make', + 'QueueFailedTable' => 'command.queue.failed-table', + 'QueueTable' => 'command.queue.table', 'RequestMake' => 'command.request.make', - 'RouteCache' => 'command.route.cache', - 'RouteClear' => 'command.route.clear', - 'RouteList' => 'command.route.list', + 'SeederMake' => 'command.seeder.make', + 'SessionTable' => 'command.session.table', 'Serve' => 'command.serve', 'TestMake' => 'command.test.make', - 'Tinker' => 'command.tinker', - 'Up' => 'command.up', 'VendorPublish' => 'command.vendor.publish', - 'ViewClear' => 'command.view.clear', ]; /** @@ -86,13 +106,26 @@ class ArtisanServiceProvider extends ServiceProvider */ public function register() { - foreach (array_keys($this->commands) as $command) { + $this->registerCommands($this->commands); + + $this->registerCommands($this->devCommands); + } + + /** + * Register the given commands. + * + * @param array $commands + * @return void + */ + protected function registerCommands(array $commands) + { + foreach (array_keys($commands) as $command) { $method = "register{$command}Command"; call_user_func_array([$this, $method], []); } - $this->commands(array_values($this->commands)); + $this->commands(array_values($commands)); } /** @@ -107,6 +140,30 @@ protected function registerAppNameCommand() }); } + /** + * Register the command. + * + * @return void + */ + protected function registerAuthMakeCommand() + { + $this->app->singleton('command.auth.make', function ($app) { + return new MakeAuthCommand; + }); + } + + /** + * Register the command. + * + * @return void + */ + protected function registerCacheTableCommand() + { + $this->app->singleton('command.cache.table', function ($app) { + return new CacheTableCommand($app['files'], $app['composer']); + }); + } + /** * Register the command. * @@ -124,10 +181,10 @@ protected function registerClearCompiledCommand() * * @return void */ - protected function registerCommandMakeCommand() + protected function registerClearResetsCommand() { - $this->app->singleton('command.command.make', function ($app) { - return new CommandMakeCommand($app['files']); + $this->app->singleton('command.auth.resets.clear', function () { + return new ClearResetsCommand; }); } @@ -167,6 +224,18 @@ protected function registerConsoleMakeCommand() }); } + /** + * Register the command. + * + * @return void + */ + protected function registerControllerMakeCommand() + { + $this->app->singleton('command.controller.make', function ($app) { + return new ControllerMakeCommand($app['files']); + }); + } + /** * Register the command. * @@ -215,30 +284,6 @@ protected function registerEnvironmentCommand() }); } - /** - * Register the command. - * - * @return void - */ - protected function registerHandlerCommandCommand() - { - $this->app->singleton('command.handler.command', function ($app) { - return new HandlerCommandCommand($app['files']); - }); - } - - /** - * Register the command. - * - * @return void - */ - protected function registerHandlerEventCommand() - { - $this->app->singleton('command.handler.event', function ($app) { - return new HandlerEventCommand($app['files']); - }); - } - /** * Register the command. * @@ -275,6 +320,18 @@ protected function registerListenerMakeCommand() }); } + /** + * Register the command. + * + * @return void + */ + protected function registerMiddlewareMakeCommand() + { + $this->app->singleton('command.middleware.make', function ($app) { + return new MiddlewareMakeCommand($app['files']); + }); + } + /** * Register the command. * @@ -311,6 +368,30 @@ protected function registerProviderMakeCommand() }); } + /** + * Register the command. + * + * @return void + */ + protected function registerQueueFailedTableCommand() + { + $this->app->singleton('command.queue.failed-table', function ($app) { + return new FailedTableCommand($app['files'], $app['composer']); + }); + } + + /** + * Register the command. + * + * @return void + */ + protected function registerQueueTableCommand() + { + $this->app->singleton('command.queue.table', function ($app) { + return new TableCommand($app['files'], $app['composer']); + }); + } + /** * Register the command. * @@ -323,6 +404,30 @@ protected function registerRequestMakeCommand() }); } + /** + * Register the command. + * + * @return void + */ + protected function registerSeederMakeCommand() + { + $this->app->singleton('command.seeder.make', function ($app) { + return new SeederMakeCommand($app['files'], $app['composer']); + }); + } + + /** + * Register the command. + * + * @return void + */ + protected function registerSessionTableCommand() + { + $this->app->singleton('command.session.table', function ($app) { + return new SessionTableCommand($app['files'], $app['composer']); + }); + } + /** * Register the command. * @@ -450,6 +555,10 @@ protected function registerPolicyMakeCommand() */ public function provides() { - return array_values($this->commands); + if ($this->app->environment('production')) { + return array_values($this->commands); + } else { + return array_merge(array_values($this->commands), array_values($this->devCommands)); + } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php old mode 100644 new mode 100755 index df68d3c..295ca96 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ComposerServiceProvider.php @@ -2,7 +2,7 @@ namespace Illuminate\Foundation\Providers; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Support\ServiceProvider; class ComposerServiceProvider extends ServiceProvider diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php index 9dc4a20..8a1ea75 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/ConsoleSupportServiceProvider.php @@ -19,13 +19,11 @@ class ConsoleSupportServiceProvider extends AggregateServiceProvider * @var array */ protected $providers = [ - 'Illuminate\Auth\GeneratorServiceProvider', + 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Console\ScheduleServiceProvider', 'Illuminate\Database\MigrationServiceProvider', 'Illuminate\Database\SeedServiceProvider', 'Illuminate\Foundation\Providers\ComposerServiceProvider', 'Illuminate\Queue\ConsoleServiceProvider', - 'Illuminate\Routing\GeneratorServiceProvider', - 'Illuminate\Session\CommandsServiceProvider', ]; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php deleted file mode 100644 index 9904c96..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php +++ /dev/null @@ -1,64 +0,0 @@ -app['events']->listen('router.matched', function () { - $this->app->resolving(function (FormRequest $request, $app) { - $this->initializeRequest($request, $app['request']); - - $request->setContainer($app)->setRedirector($app->make(Redirector::class)); - }); - }); - } - - /** - * Initialize the form request with data from the given request. - * - * @param \Illuminate\Foundation\Http\FormRequest $form - * @param \Symfony\Component\HttpFoundation\Request $current - * @return void - */ - protected function initializeRequest(FormRequest $form, Request $current) - { - $files = $current->files->all(); - - $files = is_array($files) ? array_filter($files) : $files; - - $form->initialize( - $current->query->all(), $current->request->all(), $current->attributes->all(), - $current->cookies->all(), $files, $current->server->all(), $current->getContent() - ); - - if ($session = $current->getSession()) { - $form->setSession($session); - } - - $form->setUserResolver($current->getUserResolver()); - - $form->setRouteResolver($current->getRouteResolver()); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php index f1f4837..4069e17 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php @@ -2,16 +2,76 @@ namespace Illuminate\Foundation\Providers; -use Illuminate\Support\AggregateServiceProvider; +use Illuminate\Routing\Redirector; +use Illuminate\Support\ServiceProvider; +use Illuminate\Foundation\Http\FormRequest; +use Symfony\Component\HttpFoundation\Request; +use Illuminate\Contracts\Validation\ValidatesWhenResolved; -class FoundationServiceProvider extends AggregateServiceProvider +class FoundationServiceProvider extends ServiceProvider { /** - * The provider class names. + * Register the service provider. * - * @var array + * @return void */ - protected $providers = [ - FormRequestServiceProvider::class, - ]; + public function register() + { + // + } + + /** + * Bootstrap the application services. + * + * @return void + */ + public function boot() + { + $this->configureFormRequests(); + } + + /** + * Configure the form request related services. + * + * @return void + */ + protected function configureFormRequests() + { + $this->app->afterResolving(function (ValidatesWhenResolved $resolved) { + $resolved->validate(); + }); + + $this->app->resolving(function (FormRequest $request, $app) { + $this->initializeRequest($request, $app['request']); + + $request->setContainer($app)->setRedirector($app->make(Redirector::class)); + }); + } + + /** + * Initialize the form request with data from the given request. + * + * @param \Illuminate\Foundation\Http\FormRequest $form + * @param \Symfony\Component\HttpFoundation\Request $current + * @return void + */ + protected function initializeRequest(FormRequest $form, Request $current) + { + $files = $current->files->all(); + + $files = is_array($files) ? array_filter($files) : $files; + + $form->initialize( + $current->query->all(), $current->request->all(), $current->attributes->all(), + $current->cookies->all(), $files, $current->server->all(), $current->getContent() + ); + + if ($session = $current->getSession()) { + $form->setSession($session); + } + + $form->setUserResolver($current->getUserResolver()); + + $form->setRouteResolver($current->getRouteResolver()); + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php index 602a882..996640a 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php @@ -29,7 +29,7 @@ class EventServiceProvider extends ServiceProvider */ public function boot(DispatcherContract $events) { - foreach ($this->listen as $event => $listeners) { + foreach ($this->listens() as $event => $listeners) { foreach ($listeners as $listener) { $events->listen($event, $listener); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/ApplicationTrait.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/ApplicationTrait.php deleted file mode 100644 index f8d4450..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/ApplicationTrait.php +++ /dev/null @@ -1,314 +0,0 @@ -app = $this->createApplication(); - } - - /** - * Register an instance of an object in the container. - * - * @param string $abstract - * @param object $instance - * @return object - */ - protected function instance($abstract, $instance) - { - $this->app->instance($abstract, $instance); - - return $instance; - } - - /** - * Specify a list of events that should be fired for the given operation. - * - * These events will be mocked, so that handlers will not actually be executed. - * - * @param array|mixed $events - * @return $this - */ - public function expectsEvents($events) - { - $events = is_array($events) ? $events : func_get_args(); - - $mock = Mockery::spy('Illuminate\Contracts\Events\Dispatcher'); - - $mock->shouldReceive('fire')->andReturnUsing(function ($called) use (&$events) { - foreach ($events as $key => $event) { - if ((is_string($called) && $called === $event) || - (is_string($called) && is_subclass_of($called, $event)) || - (is_object($called) && $called instanceof $event)) { - unset($events[$key]); - } - } - }); - - $this->beforeApplicationDestroyed(function () use (&$events) { - if ($events) { - throw new Exception( - 'The following events were not fired: ['.implode(', ', $events).']' - ); - } - }); - - $this->app->instance('events', $mock); - - return $this; - } - - /** - * Mock the event dispatcher so all events are silenced. - * - * @return $this - */ - protected function withoutEvents() - { - $mock = Mockery::mock('Illuminate\Contracts\Events\Dispatcher'); - - $mock->shouldReceive('fire'); - - $this->app->instance('events', $mock); - - return $this; - } - - /** - * Specify a list of jobs that should be dispatched for the given operation. - * - * These jobs will be mocked, so that handlers will not actually be executed. - * - * @param array|mixed $jobs - * @return $this - */ - protected function expectsJobs($jobs) - { - $jobs = is_array($jobs) ? $jobs : func_get_args(); - - $mock = Mockery::mock('Illuminate\Bus\Dispatcher[dispatch]', [$this->app]); - - foreach ($jobs as $job) { - $mock->shouldReceive('dispatch')->atLeast()->once() - ->with(Mockery::type($job)); - } - - $this->app->instance( - 'Illuminate\Contracts\Bus\Dispatcher', $mock - ); - - return $this; - } - - /** - * Set the session to the given array. - * - * @param array $data - * @return $this - */ - public function withSession(array $data) - { - $this->session($data); - - return $this; - } - - /** - * Set the session to the given array. - * - * @param array $data - * @return void - */ - public function session(array $data) - { - $this->startSession(); - - foreach ($data as $key => $value) { - $this->app['session']->put($key, $value); - } - } - - /** - * Start the session for the application. - * - * @return void - */ - protected function startSession() - { - if (! $this->app['session']->isStarted()) { - $this->app['session']->start(); - } - } - - /** - * Flush all of the current session data. - * - * @return void - */ - public function flushSession() - { - $this->startSession(); - - $this->app['session']->flush(); - } - - /** - * Disable middleware for the test. - * - * @return $this - */ - public function withoutMiddleware() - { - $this->app->instance('middleware.disable', true); - - return $this; - } - - /** - * Set the currently logged in user for the application. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string|null $driver - * @return $this - */ - public function actingAs(UserContract $user, $driver = null) - { - $this->be($user, $driver); - - return $this; - } - - /** - * Set the currently logged in user for the application. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string|null $driver - * @return void - */ - public function be(UserContract $user, $driver = null) - { - $this->app['auth']->driver($driver)->setUser($user); - } - - /** - * Assert that a given where condition exists in the database. - * - * @param string $table - * @param array $data - * @param string $connection - * @return $this - */ - protected function seeInDatabase($table, array $data, $connection = null) - { - $database = $this->app->make('db'); - - $connection = $connection ?: $database->getDefaultConnection(); - - $count = $database->connection($connection)->table($table)->where($data)->count(); - - $this->assertGreaterThan(0, $count, sprintf( - 'Unable to find row in database table [%s] that matched attributes [%s].', $table, json_encode($data) - )); - - return $this; - } - - /** - * Assert that a given where condition does not exist in the database. - * - * @param string $table - * @param array $data - * @param string $connection - * @return $this - */ - protected function missingFromDatabase($table, array $data, $connection = null) - { - return $this->notSeeInDatabase($table, $data, $connection); - } - - /** - * Assert that a given where condition does not exist in the database. - * - * @param string $table - * @param array $data - * @param string $connection - * @return $this - */ - protected function dontSeeInDatabase($table, array $data, $connection = null) - { - return $this->notSeeInDatabase($table, $data, $connection); - } - - /** - * Assert that a given where condition does not exist in the database. - * - * @param string $table - * @param array $data - * @param string $connection - * @return $this - */ - protected function notSeeInDatabase($table, array $data, $connection = null) - { - $database = $this->app->make('db'); - - $connection = $connection ?: $database->getDefaultConnection(); - - $count = $database->connection($connection)->table($table)->where($data)->count(); - - $this->assertEquals(0, $count, sprintf( - 'Found unexpected records in database table [%s] that matched attributes [%s].', $table, json_encode($data) - )); - - return $this; - } - - /** - * Seed a given database connection. - * - * @param string $class - * @return void - */ - public function seed($class = 'DatabaseSeeder') - { - $this->artisan('db:seed', ['--class' => $class]); - } - - /** - * Call artisan command and return code. - * - * @param string $command - * @param array $parameters - * @return int - */ - public function artisan($command, $parameters = []) - { - return $this->code = $this->app['Illuminate\Contracts\Console\Kernel']->call($command, $parameters); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/AssertionsTrait.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/AssertionsTrait.php deleted file mode 100644 index 26b288e..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/AssertionsTrait.php +++ /dev/null @@ -1,203 +0,0 @@ -response->getStatusCode(); - - return PHPUnit::assertTrue($this->response->isOk(), "Expected status code 200, got {$actual}."); - } - - /** - * Assert that the client response has a given code. - * - * @param int $code - * @return void - */ - public function assertResponseStatus($code) - { - $actual = $this->response->getStatusCode(); - - return PHPUnit::assertEquals($code, $this->response->getStatusCode(), "Expected status code {$code}, got {$actual}."); - } - - /** - * Assert that the response view has a given piece of bound data. - * - * @param string|array $key - * @param mixed $value - * @return void - */ - public function assertViewHas($key, $value = null) - { - if (is_array($key)) { - return $this->assertViewHasAll($key); - } - - if (! isset($this->response->original) || ! $this->response->original instanceof View) { - return PHPUnit::assertTrue(false, 'The response was not a view.'); - } - - if (is_null($value)) { - PHPUnit::assertArrayHasKey($key, $this->response->original->getData()); - } else { - PHPUnit::assertEquals($value, $this->response->original->$key); - } - } - - /** - * Assert that the view has a given list of bound data. - * - * @param array $bindings - * @return void - */ - public function assertViewHasAll(array $bindings) - { - foreach ($bindings as $key => $value) { - if (is_int($key)) { - $this->assertViewHas($value); - } else { - $this->assertViewHas($key, $value); - } - } - } - - /** - * Assert that the response view is missing a piece of bound data. - * - * @param string $key - * @return void - */ - public function assertViewMissing($key) - { - if (! isset($this->response->original) || ! $this->response->original instanceof View) { - return PHPUnit::assertTrue(false, 'The response was not a view.'); - } - - PHPUnit::assertArrayNotHasKey($key, $this->response->original->getData()); - } - - /** - * Assert whether the client was redirected to a given URI. - * - * @param string $uri - * @param array $with - * @return void - */ - public function assertRedirectedTo($uri, $with = []) - { - PHPUnit::assertInstanceOf('Illuminate\Http\RedirectResponse', $this->response); - - PHPUnit::assertEquals($this->app['url']->to($uri), $this->response->headers->get('Location')); - - $this->assertSessionHasAll($with); - } - - /** - * Assert whether the client was redirected to a given route. - * - * @param string $name - * @param array $parameters - * @param array $with - * @return void - */ - public function assertRedirectedToRoute($name, $parameters = [], $with = []) - { - $this->assertRedirectedTo($this->app['url']->route($name, $parameters), $with); - } - - /** - * Assert whether the client was redirected to a given action. - * - * @param string $name - * @param array $parameters - * @param array $with - * @return void - */ - public function assertRedirectedToAction($name, $parameters = [], $with = []) - { - $this->assertRedirectedTo($this->app['url']->action($name, $parameters), $with); - } - - /** - * Assert that the session has a given value. - * - * @param string|array $key - * @param mixed $value - * @return void - */ - public function assertSessionHas($key, $value = null) - { - if (is_array($key)) { - return $this->assertSessionHasAll($key); - } - - if (is_null($value)) { - PHPUnit::assertTrue($this->app['session.store']->has($key), "Session missing key: $key"); - } else { - PHPUnit::assertEquals($value, $this->app['session.store']->get($key)); - } - } - - /** - * Assert that the session has a given list of values. - * - * @param array $bindings - * @return void - */ - public function assertSessionHasAll(array $bindings) - { - foreach ($bindings as $key => $value) { - if (is_int($key)) { - $this->assertSessionHas($value); - } else { - $this->assertSessionHas($key, $value); - } - } - } - - /** - * Assert that the session has errors bound. - * - * @param string|array $bindings - * @param mixed $format - * @return void - */ - public function assertSessionHasErrors($bindings = [], $format = null) - { - $this->assertSessionHas('errors'); - - $bindings = (array) $bindings; - - $errors = $this->app['session.store']->get('errors'); - - foreach ($bindings as $key => $value) { - if (is_int($key)) { - PHPUnit::assertTrue($errors->has($value), "Session missing error: $value"); - } else { - PHPUnit::assertContains($value, $errors->get($key, $format)); - } - } - } - - /** - * Assert that the session has old input. - * - * @return void - */ - public function assertHasOldInput() - { - $this->assertSessionHas('_old_input'); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php new file mode 100644 index 0000000..f07e2f0 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php @@ -0,0 +1,34 @@ +be($user, $driver); + + return $this; + } + + /** + * Set the currently logged in user for the application. + * + * @param \Illuminate\Contracts\Auth\Authenticatable $user + * @param string|null $driver + * @return void + */ + public function be(UserContract $user, $driver = null) + { + $this->app['auth']->guard($driver)->setUser($user); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php new file mode 100644 index 0000000..413ff5f --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php @@ -0,0 +1,115 @@ +assertTrue($this->isAuthenticated($guard), 'The user is not authenticated'); + + return $this; + } + + /** + * Assert that the user is not authenticated. + * + * @param string|null $guard + * @return $this + */ + public function dontSeeIsAuthenticated($guard = null) + { + $this->assertFalse($this->isAuthenticated($guard), 'The user is authenticated'); + + return $this; + } + + /** + * Return true if the user is authenticated, false otherwise. + * + * @param string|null $guard + * @return bool + */ + protected function isAuthenticated($guard = null) + { + return $this->app->make('auth')->guard($guard)->check(); + } + + /** + * Assert that the user is authenticated as the given user. + * + * @param $user + * @param string|null $guard + * @return $this + */ + public function seeIsAuthenticatedAs($user, $guard = null) + { + $expected = $this->app->make('auth')->guard($guard)->user(); + + $this->assertInstanceOf( + get_class($expected), $user, + 'The currently authenticated user is not who was expected' + ); + + $this->assertSame( + $expected->getAuthIdentifier(), $user->getAuthIdentifier(), + 'The currently authenticated user is not who was expected' + ); + + return $this; + } + + /** + * Assert that the given credentials are valid. + * + * @param array $credentials + * @param string|null $guard + * @return $this + */ + public function seeCredentials(array $credentials, $guard = null) + { + $this->assertTrue( + $this->hasCredentials($credentials, $guard), 'The given credentials are invalid.' + ); + + return $this; + } + + /** + * Assert that the given credentials are invalid. + * + * @param array $credentials + * @param string|null $guard + * @return $this + */ + public function dontSeeCredentials(array $credentials, $guard = null) + { + $this->assertFalse( + $this->hasCredentials($credentials, $guard), 'The given credentials are valid.' + ); + + return $this; + } + + /** + * Return true is the credentials are valid, false otherwise. + * + * @param array $credentials + * @param string|null $guard + * @return bool + */ + protected function hasCredentials(array $credentials, $guard = null) + { + $provider = $this->app->make('auth')->guard($guard)->getProvider(); + + $user = $provider->retrieveByCredentials($credentials); + + return $user && $provider->validateCredentials($user, $credentials); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php new file mode 100644 index 0000000..5b18428 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php @@ -0,0 +1,27 @@ +code = $this->app[Kernel::class]->call($command, $parameters); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php new file mode 100644 index 0000000..71d1e8e --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithContainer.php @@ -0,0 +1,20 @@ +app->instance($abstract, $instance); + + return $instance; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php new file mode 100644 index 0000000..e5aae77 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php @@ -0,0 +1,89 @@ +app->make('db'); + + $connection = $connection ?: $database->getDefaultConnection(); + + $count = $database->connection($connection)->table($table)->where($data)->count(); + + $this->assertGreaterThan(0, $count, sprintf( + 'Unable to find row in database table [%s] that matched attributes [%s].', $table, json_encode($data) + )); + + return $this; + } + + /** + * Assert that a given where condition does not exist in the database. + * + * @param string $table + * @param array $data + * @param string $connection + * @return $this + */ + protected function missingFromDatabase($table, array $data, $connection = null) + { + return $this->notSeeInDatabase($table, $data, $connection); + } + + /** + * Assert that a given where condition does not exist in the database. + * + * @param string $table + * @param array $data + * @param string $connection + * @return $this + */ + protected function dontSeeInDatabase($table, array $data, $connection = null) + { + return $this->notSeeInDatabase($table, $data, $connection); + } + + /** + * Assert that a given where condition does not exist in the database. + * + * @param string $table + * @param array $data + * @param string $connection + * @return $this + */ + protected function notSeeInDatabase($table, array $data, $connection = null) + { + $database = $this->app->make('db'); + + $connection = $connection ?: $database->getDefaultConnection(); + + $count = $database->connection($connection)->table($table)->where($data)->count(); + + $this->assertEquals(0, $count, sprintf( + 'Found unexpected records in database table [%s] that matched attributes [%s].', $table, json_encode($data) + )); + + return $this; + } + + /** + * Seed a given database connection. + * + * @param string $class + * @return void + */ + public function seed($class = 'DatabaseSeeder') + { + $this->artisan('db:seed', ['--class' => $class]); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/InteractsWithPages.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php similarity index 60% rename from application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/InteractsWithPages.php rename to application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php index ff264e8..28db9d4 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/InteractsWithPages.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithPages.php @@ -1,13 +1,23 @@ crawler = null; + + $this->subCrawlers = []; + } + /** * Make a request to the application using the given form. * @@ -149,6 +178,8 @@ protected function seePageIs($uri) * @param string $uri * @param string|null $message * @return void + * + * @throws \Illuminate\Foundation\Testing\HttpException */ protected function assertPageLoaded($uri, $message = null) { @@ -167,412 +198,251 @@ protected function assertPageLoaded($uri, $message = null) } /** - * Assert that a given string is seen on the page. + * Narrow the test content to a specific area of the page. * - * @param string $text - * @param bool $negate + * @param string $element + * @param \Closure $callback * @return $this */ - protected function see($text, $negate = false) + public function within($element, Closure $callback) { - $method = $negate ? 'assertNotRegExp' : 'assertRegExp'; - - $rawPattern = preg_quote($text, '/'); + $this->subCrawlers[] = $this->crawler()->filter($element); - $escapedPattern = preg_quote(e($text), '/'); + $callback(); - $pattern = $rawPattern == $escapedPattern - ? $rawPattern : "({$rawPattern}|{$escapedPattern})"; - - $this->$method("/$pattern/i", $this->response->getContent()); + array_pop($this->subCrawlers); return $this; } /** - * Assert that a given string is not seen on the page. + * Get the current crawler according to the test context. * - * @param string $text - * @return $this + * @return \Symfony\Component\DomCrawler\Crawler */ - protected function dontSee($text) + protected function crawler() { - return $this->see($text, true); + if (! empty($this->subCrawlers)) { + return end($this->subCrawlers); + } + + return $this->crawler; } /** - * Assert that a given string is seen inside an element. + * Assert the given constraint. * - * @param string $element - * @param string $text - * @param bool $negate + * @param \Illuminate\Foundation\Testing\Constraints\PageConstraint $constraint + * @param bool $reverse + * @param string $message * @return $this */ - public function seeInElement($element, $text, $negate = false) + protected function assertInPage(PageConstraint $constraint, $reverse = false, $message = '') { - if ($negate) { - return $this->dontSeeInElement($element, $text); + if ($reverse) { + $constraint = new ReversePageConstraint($constraint); } - $this->assertTrue( - $this->hasInElement($element, $text), - "Element [$element] should contain the expected text [{$text}]" + self::assertThat( + $this->crawler() ?: $this->response->getContent(), + $constraint, $message ); return $this; } /** - * Assert that a given string is not seen inside an element. + * Assert that a given string is seen on the current HTML. * - * @param string $element * @param string $text + * @param bool $negate * @return $this */ - public function dontSeeInElement($element, $text) + public function see($text, $negate = false) { - $this->assertFalse( - $this->hasInElement($element, $text), - "Element [$element] should not contain the expected text [{$text}]" - ); - - return $this; + return $this->assertInPage(new HasSource($text), $negate); } /** - * Check if the page contains text within the given element. + * Assert that a given string is not seen on the current HTML. * - * @param string $element * @param string $text - * @return bool + * @return $this */ - protected function hasInElement($element, $text) + public function dontSee($text) { - $elements = $this->crawler->filter($element); - - $rawPattern = preg_quote($text, '/'); - - $escapedPattern = preg_quote(e($text), '/'); - - $pattern = $rawPattern == $escapedPattern - ? $rawPattern : "({$rawPattern}|{$escapedPattern})"; - - foreach ($elements as $element) { - $element = new Crawler($element); - - if (preg_match("/$pattern/i", $element->html())) { - return true; - } - } - - return false; + return $this->assertInPage(new HasSource($text), true); } /** - * Assert that a given link is seen on the page. + * Assert that an element is present on the page. * - * @param string $text - * @param string|null $url + * @param string $selector + * @param array $attributes + * @param bool $negate * @return $this */ - public function seeLink($text, $url = null) + public function seeElement($selector, array $attributes = [], $negate = false) { - $message = "No links were found with expected text [{$text}]"; - - if ($url) { - $message .= " and URL [{$url}]"; - } - - $this->assertTrue($this->hasLink($text, $url), "{$message}."); - - return $this; + return $this->assertInPage(new HasElement($selector, $attributes), $negate); } /** - * Assert that a given link is not seen on the page. + * Assert that an element is not present on the page. * - * @param string $text - * @param string|null $url + * @param string $selector + * @param array $attributes * @return $this */ - public function dontSeeLink($text, $url = null) + public function dontSeeElement($selector, array $attributes = []) { - $message = "A link was found with expected text [{$text}]"; - - if ($url) { - $message .= " and URL [{$url}]"; - } - - $this->assertFalse($this->hasLink($text, $url), "{$message}."); - - return $this; + return $this->assertInPage(new HasElement($selector, $attributes), true); } /** - * Check if the page has a link with the given $text and optional $url. + * Assert that a given string is seen on the current text. * * @param string $text - * @param string|null $url - * @return bool + * @param bool $negate + * @return $this */ - protected function hasLink($text, $url = null) + public function seeText($text, $negate = false) { - $links = $this->crawler->selectLink($text); - - if ($links->count() == 0) { - return false; - } - - // If the URL is null, we assume the developer only wants to find a link - // with the given text regardless of the URL. So, if we find the link - // we will return true now. Otherwise, we look for the given URL. - if ($url == null) { - return true; - } - - $url = $this->addRootToRelativeUrl($url); - - foreach ($links as $link) { - if ($link->getAttribute('href') == $url) { - return true; - } - } - - return false; + return $this->assertInPage(new HasText($text), $negate); } /** - * Add a root if the URL is relative (helper method of the hasLink function). + * Assert that a given string is not seen on the current text. * - * @param string $url - * @return string + * @param string $text + * @return $this */ - protected function addRootToRelativeUrl($url) + public function dontSeeText($text) { - if (! Str::startsWith($url, ['http', 'https'])) { - return $this->app->make('url')->to($url); - } - - return $url; + return $this->assertInPage(new HasText($text), true); } /** - * Assert that an input field contains the given value. + * Assert that a given string is seen inside an element. * - * @param string $selector - * @param string $expected + * @param string $element + * @param string $text + * @param bool $negate * @return $this */ - public function seeInField($selector, $expected) + public function seeInElement($element, $text, $negate = false) { - $this->assertSame( - $expected, $this->getInputOrTextAreaValue($selector), - "The field [{$selector}] does not contain the expected value [{$expected}]." - ); - - return $this; + return $this->assertInPage(new HasInElement($element, $text), $negate); } /** - * Assert that an input field does not contain the given value. + * Assert that a given string is not seen inside an element. * - * @param string $selector - * @param string $value + * @param string $element + * @param string $text * @return $this */ - public function dontSeeInField($selector, $value) + public function dontSeeInElement($element, $text) { - $this->assertNotSame( - $this->getInputOrTextAreaValue($selector), $value, - "The input [{$selector}] should not contain the value [{$value}]." - ); - - return $this; + return $this->assertInPage(new HasInElement($element, $text), true); } /** - * Assert that the given checkbox is selected. + * Assert that a given link is seen on the page. * - * @param string $selector + * @param string $text + * @param string|null $url + * @param bool $negate * @return $this */ - public function seeIsChecked($selector) + public function seeLink($text, $url = null, $negate = false) { - $this->assertTrue( - $this->isChecked($selector), - "The checkbox [{$selector}] is not checked." - ); - - return $this; + return $this->assertInPage(new HasLink($text, $url), $negate); } /** - * Assert that the given checkbox is not selected. + * Assert that a given link is not seen on the page. * - * @param string $selector + * @param string $text + * @param string|null $url * @return $this */ - public function dontSeeIsChecked($selector) + public function dontSeeLink($text, $url = null) { - $this->assertFalse( - $this->isChecked($selector), - "The checkbox [{$selector}] is checked." - ); - - return $this; + return $this->assertInPage(new HasLink($text, $url), true); } /** - * Assert that the expected value is selected. + * Assert that an input field contains the given value. * * @param string $selector * @param string $expected + * @param bool $negate * @return $this */ - public function seeIsSelected($selector, $expected) + public function seeInField($selector, $expected, $negate = false) { - $this->assertEquals( - $expected, $this->getSelectedValue($selector), - "The field [{$selector}] does not contain the selected value [{$expected}]." - ); - - return $this; + return $this->assertInPage(new HasValue($selector, $expected), $negate); } /** - * Assert that the given value is not selected. + * Assert that an input field does not contain the given value. * * @param string $selector * @param string $value * @return $this */ - public function dontSeeIsSelected($selector, $value) + public function dontSeeInField($selector, $value) { - $this->assertNotEquals( - $value, $this->getSelectedValue($selector), - "The field [{$selector}] contains the selected value [{$value}]." - ); - - return $this; + return $this->assertInPage(new HasValue($selector, $value), true); } /** - * Get the value of an input or textarea. + * Assert that the expected value is selected. * * @param string $selector - * @return string - * - * @throws \Exception + * @param string $value + * @param bool $negate + * @return $this */ - protected function getInputOrTextAreaValue($selector) + public function seeIsSelected($selector, $value, $negate = false) { - $field = $this->filterByNameOrId($selector, ['input', 'textarea']); - - if ($field->count() == 0) { - throw new Exception("There are no elements with the name or ID [$selector]."); - } - - $element = $field->nodeName(); - - if ($element == 'input') { - return $field->attr('value'); - } - - if ($element == 'textarea') { - return $field->text(); - } - - throw new Exception("Given selector [$selector] is not an input or textarea."); + return $this->assertInPage(new IsSelected($selector, $value), $negate); } /** - * Get the selected value of a select field or radio group. + * Assert that the given value is not selected. * * @param string $selector - * @return string|null - * - * @throws \Exception + * @param string $value + * @return $this */ - protected function getSelectedValue($selector) + public function dontSeeIsSelected($selector, $value) { - $field = $this->filterByNameOrId($selector); - - if ($field->count() == 0) { - throw new Exception("There are no elements with the name or ID [$selector]."); - } - - $element = $field->nodeName(); - - if ($element == 'select') { - return $this->getSelectedValueFromSelect($field); - } - - if ($element == 'input') { - return $this->getCheckedValueFromRadioGroup($field); - } - - throw new Exception("Given selector [$selector] is not a select or radio group."); + return $this->assertInPage(new IsSelected($selector, $value), true); } /** - * Get the selected value from a select field. - * - * @param \Symfony\Component\DomCrawler\Crawler $field - * @return string|null - * - * @throws \Exception - */ - protected function getSelectedValueFromSelect(Crawler $field) - { - if ($field->nodeName() !== 'select') { - throw new Exception('Given element is not a select element.'); - } - - foreach ($field->children() as $option) { - if ($option->hasAttribute('selected')) { - return $option->getAttribute('value'); - } - } - } - - /** - * Get the checked value from a radio group. - * - * @param \Symfony\Component\DomCrawler\Crawler $radioGroup - * @return string|null + * Assert that the given checkbox is selected. * - * @throws \Exception + * @param string $selector + * @param bool $negate + * @return $this */ - protected function getCheckedValueFromRadioGroup(Crawler $radioGroup) + public function seeIsChecked($selector, $negate = false) { - if ($radioGroup->nodeName() !== 'input' || $radioGroup->attr('type') !== 'radio') { - throw new Exception('Given element is not a radio button.'); - } - - foreach ($radioGroup as $radio) { - if ($radio->hasAttribute('checked')) { - return $radio->getAttribute('value'); - } - } + return $this->assertInPage(new IsChecked($selector), $negate); } /** - * Return true if the given checkbox is checked, false otherwise. + * Assert that the given checkbox is not selected. * * @param string $selector - * @return bool - * - * @throws \Exception + * @return $this */ - protected function isChecked($selector) + public function dontSeeIsChecked($selector) { - $checkbox = $this->filterByNameOrId($selector, "input[type='checkbox']"); - - if ($checkbox->count() == 0) { - throw new Exception("There are no checkbox elements with the name or ID [$selector]."); - } - - return $checkbox->attr('checked') !== null; + return $this->assertInPage(new IsChecked($selector), true); } /** @@ -580,10 +450,12 @@ protected function isChecked($selector) * * @param string $name * @return $this + * + * @throws \InvalidArgumentException */ protected function click($name) { - $link = $this->crawler->selectLink($name); + $link = $this->crawler()->selectLink($name); if (! count($link)) { $link = $this->filterByNameOrId($name, 'a'); @@ -709,15 +581,17 @@ protected function fillForm($buttonText, $inputs = []) * * @param string|null $buttonText * @return \Symfony\Component\DomCrawler\Form + * + * @throws \InvalidArgumentException */ protected function getForm($buttonText = null) { try { if ($buttonText) { - return $this->crawler->selectButton($buttonText)->form(); + return $this->crawler()->selectButton($buttonText)->form(); } - return $this->crawler->filter('form')->form(); + return $this->crawler()->filter('form')->form(); } catch (InvalidArgumentException $e) { throw new InvalidArgumentException( "Could not find a form that has submit button [{$buttonText}]." @@ -748,6 +622,8 @@ protected function storeInput($element, $text) * * @param string $filter * @return void + * + * @throws \InvalidArgumentException */ protected function assertFilterProducesResults($filter) { @@ -779,7 +655,7 @@ protected function filterByNameOrId($name, $elements = '*') $element = "{$element}#{$id}, {$element}[name='{$name}']"; }); - return $this->crawler->filter(implode(', ', $elements)); + return $this->crawler()->filter(implode(', ', $elements)); } /** @@ -810,7 +686,7 @@ protected function convertUploadsForTesting(Form $form, array $uploads) * @param array $file * @param array $uploads * @param string $name - * @return \Symfony\Component\HttpFoundation\File\UploadedFile + * @return \Illuminate\Http\UploadedFile */ protected function getUploadedFileForTesting($file, $uploads, $name) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php new file mode 100644 index 0000000..d5f805f --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php @@ -0,0 +1,162 @@ +session($data); + + return $this; + } + + /** + * Set the session to the given array. + * + * @param array $data + * @return void + */ + public function session(array $data) + { + $this->startSession(); + + foreach ($data as $key => $value) { + $this->app['session']->put($key, $value); + } + } + + /** + * Start the session for the application. + * + * @return void + */ + protected function startSession() + { + if (! $this->app['session']->isStarted()) { + $this->app['session']->start(); + } + } + + /** + * Flush all of the current session data. + * + * @return void + */ + public function flushSession() + { + $this->startSession(); + + $this->app['session']->flush(); + } + + /** + * Assert that the session has a given value. + * + * @param string|array $key + * @param mixed $value + * @return void + */ + public function seeInSession($key, $value = null) + { + $this->assertSessionHas($key, $value); + + return $this; + } + + /** + * Assert that the session has a given value. + * + * @param string|array $key + * @param mixed $value + * @return void + */ + public function assertSessionHas($key, $value = null) + { + if (is_array($key)) { + return $this->assertSessionHasAll($key); + } + + if (is_null($value)) { + PHPUnit::assertTrue($this->app['session.store']->has($key), "Session missing key: $key"); + } else { + PHPUnit::assertEquals($value, $this->app['session.store']->get($key)); + } + } + + /** + * Assert that the session has a given list of values. + * + * @param array $bindings + * @return void + */ + public function assertSessionHasAll(array $bindings) + { + foreach ($bindings as $key => $value) { + if (is_int($key)) { + $this->assertSessionHas($value); + } else { + $this->assertSessionHas($key, $value); + } + } + } + + /** + * Assert that the session does not have a given key. + * + * @param string|array $key + * @return void + */ + public function assertSessionMissing($key) + { + if (is_array($key)) { + foreach ($key as $k) { + $this->assertSessionMissing($k); + } + } else { + PHPUnit::assertFalse($this->app['session.store']->has($key), "Session has unexpected key: $key"); + } + } + + /** + * Assert that the session has errors bound. + * + * @param string|array $bindings + * @param mixed $format + * @return void + */ + public function assertSessionHasErrors($bindings = [], $format = null) + { + $this->assertSessionHas('errors'); + + $bindings = (array) $bindings; + + $errors = $this->app['session.store']->get('errors'); + + foreach ($bindings as $key => $value) { + if (is_int($key)) { + PHPUnit::assertTrue($errors->has($value), "Session missing error: $value"); + } else { + PHPUnit::assertContains($value, $errors->get($key, $format)); + } + } + } + + /** + * Assert that the session has old input. + * + * @return void + */ + public function assertHasOldInput() + { + $this->assertSessionHas('_old_input'); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/CrawlerTrait.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php similarity index 60% rename from application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/CrawlerTrait.php rename to application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php index c3c59dd..64153d8 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/CrawlerTrait.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php @@ -1,12 +1,16 @@ app->instance('middleware.disable', true); + + return $this; + } + /** * Visit the given URI with a JSON request. * @@ -42,6 +58,8 @@ trait CrawlerTrait */ public function json($method, $uri, array $data = [], array $headers = []) { + $files = $this->extractFilesFromDataArray($data); + $content = json_encode($data); $headers = array_merge([ @@ -51,12 +69,33 @@ public function json($method, $uri, array $data = [], array $headers = []) ], $headers); $this->call( - $method, $uri, [], [], [], $this->transformHeadersToServerVars($headers), $content + $method, $uri, [], [], $files, $this->transformHeadersToServerVars($headers), $content ); return $this; } + /** + * Extract the file uploads from the given data array. + * + * @param array $data + * @return array + */ + protected function extractFilesFromDataArray(&$data) + { + $files = []; + + foreach ($data as $key => $value) { + if ($value instanceof SymfonyUploadedFile) { + $files[$key] = $value; + + unset($data[$key]); + } + } + + return $files; + } + /** * Visit the given URI with a GET request. * @@ -177,11 +216,7 @@ protected function shouldReturnJson(array $data = null) */ protected function receiveJson($data = null) { - $this->seeJson(); - - if (! is_null($data)) { - return $this->seeJson($data); - } + return $this->seeJson($data); } /** @@ -218,7 +253,13 @@ public function seeJson(array $data = null, $negate = false) return $this; } - return $this->seeJsonContains($data, $negate); + try { + $this->seeJsonEquals($data); + + return $this; + } catch (PHPUnit_Framework_ExpectationFailedException $e) { + return $this->seeJsonContains($data, $negate); + } } /** @@ -232,6 +273,41 @@ public function dontSeeJson(array $data = null) return $this->seeJson($data, true); } + /** + * Assert that the JSON response has a given structure. + * + * @param array|null $structure + * @param array|null $responseData + * @return $this + */ + public function seeJsonStructure(array $structure = null, $responseData = null) + { + if (is_null($structure)) { + return $this->seeJson(); + } + + if (! $responseData) { + $responseData = json_decode($this->response->getContent(), true); + } + + foreach ($structure as $key => $value) { + if (is_array($value) && $key === '*') { + $this->assertInternalType('array', $responseData); + + foreach ($responseData as $responseDataItem) { + $this->seeJsonStructure($structure['*'], $responseDataItem); + } + } elseif (is_array($value)) { + $this->assertArrayHasKey($key, $responseData); + $this->seeJsonStructure($structure[$key], $responseData[$key]); + } else { + $this->assertArrayHasKey($value, $responseData); + } + } + + return $this; + } + /** * Assert that the response contains the given JSON. * @@ -243,14 +319,8 @@ protected function seeJsonContains(array $data, $negate = false) { $method = $negate ? 'assertFalse' : 'assertTrue'; - $actual = json_decode($this->response->getContent(), true); - - if (is_null($actual) || $actual === false) { - return $this->fail('Invalid JSON was returned from the route. Perhaps an exception was thrown?'); - } - $actual = json_encode(Arr::sortRecursive( - (array) $actual + (array) $this->decodeResponseJson() )); foreach (Arr::sortRecursive($data) as $key => $value) { @@ -265,6 +335,35 @@ protected function seeJsonContains(array $data, $negate = false) return $this; } + /** + * Assert that the response is a superset of the given JSON. + * + * @param array $data + * @return $this + */ + protected function seeJsonSubset(array $data) + { + $this->assertArraySubset($data, $this->decodeResponseJson()); + + return $this; + } + + /** + * Validate and return the decoded response JSON. + * + * @return array + */ + protected function decodeResponseJson() + { + $decodedResponse = json_decode($this->response->getContent(), true); + + if (is_null($decodedResponse) || $decodedResponse === false) { + $this->fail('Invalid JSON was returned from the route. Perhaps an exception was thrown?'); + } + + return $decodedResponse; + } + /** * Format the given key and value into a JSON string for expectation checks. * @@ -303,8 +402,8 @@ protected function seeStatusCode($status) /** * Asserts that the response contains the given header and equals the optional value. * - * @param string $headerName - * @param mixed $value + * @param string $headerName + * @param mixed $value * @return $this */ protected function seeHeader($headerName, $value = null) @@ -326,11 +425,24 @@ protected function seeHeader($headerName, $value = null) /** * Asserts that the response contains the given cookie and equals the optional value. * - * @param string $cookieName - * @param mixed $value + * @param string $cookieName + * @param mixed $value + * @return $this + */ + protected function seePlainCookie($cookieName, $value = null) + { + return $this->seeCookie($cookieName, $value, false); + } + + /** + * Asserts that the response contains the given cookie and equals the optional value. + * + * @param string $cookieName + * @param mixed $value + * @param bool $encrypted * @return $this */ - protected function seeCookie($cookieName, $value = null) + protected function seeCookie($cookieName, $value = null, $encrypted = true) { $headers = $this->response->headers; @@ -345,13 +457,20 @@ protected function seeCookie($cookieName, $value = null) $this->assertTrue($exist, "Cookie [{$cookieName}] not present on response."); - if (! is_null($value)) { - $this->assertEquals( - $cookie->getValue(), $value, - "Cookie [{$cookieName}] was found, but value [{$cookie->getValue()}] does not match [{$value}]." - ); + if (! $exist || is_null($value)) { + return $this; } + $cookieValue = $cookie->getValue(); + + $actual = $encrypted + ? $this->app['encrypter']->decrypt($cookieValue) : $cookieValue; + + $this->assertEquals( + $actual, $value, + "Cookie [{$cookieName}] was found, but value [{$actual}] does not match [{$value}]." + ); + return $this; } @@ -386,6 +505,8 @@ public function call($method, $uri, $parameters = [], $cookies = [], $files = [] $this->currentUri = $this->prepareUrlForRequest($uri); + $this->resetPageContext(); + $request = Request::create( $this->currentUri, $method, $parameters, $cookies, $files, array_replace($this->serverVariables, $server), $content @@ -490,7 +611,7 @@ protected function transformHeadersToServerVars(array $headers) foreach ($headers as $name => $value) { $name = strtr(strtoupper($name), '-', '_'); - if (! starts_with($name, $prefix) && $name != 'CONTENT_TYPE') { + if (! Str::startsWith($name, $prefix) && $name != 'CONTENT_TYPE') { $name = $prefix.$name; } @@ -500,6 +621,141 @@ protected function transformHeadersToServerVars(array $headers) return $server; } + /** + * Assert that the client response has an OK status code. + * + * @return $this + */ + public function assertResponseOk() + { + $actual = $this->response->getStatusCode(); + + PHPUnit::assertTrue($this->response->isOk(), "Expected status code 200, got {$actual}."); + + return $this; + } + + /** + * Assert that the client response has a given code. + * + * @param int $code + * @return $this + */ + public function assertResponseStatus($code) + { + $actual = $this->response->getStatusCode(); + + PHPUnit::assertEquals($code, $this->response->getStatusCode(), "Expected status code {$code}, got {$actual}."); + + return $this; + } + + /** + * Assert that the response view has a given piece of bound data. + * + * @param string|array $key + * @param mixed $value + * @return $this + */ + public function assertViewHas($key, $value = null) + { + if (is_array($key)) { + return $this->assertViewHasAll($key); + } + + if (! isset($this->response->original) || ! $this->response->original instanceof View) { + return PHPUnit::assertTrue(false, 'The response was not a view.'); + } + + if (is_null($value)) { + PHPUnit::assertArrayHasKey($key, $this->response->original->getData()); + } else { + PHPUnit::assertEquals($value, $this->response->original->$key); + } + + return $this; + } + + /** + * Assert that the view has a given list of bound data. + * + * @param array $bindings + * @return $this + */ + public function assertViewHasAll(array $bindings) + { + foreach ($bindings as $key => $value) { + if (is_int($key)) { + $this->assertViewHas($value); + } else { + $this->assertViewHas($key, $value); + } + } + + return $this; + } + + /** + * Assert that the response view is missing a piece of bound data. + * + * @param string $key + * @return $this + */ + public function assertViewMissing($key) + { + if (! isset($this->response->original) || ! $this->response->original instanceof View) { + return PHPUnit::assertTrue(false, 'The response was not a view.'); + } + + PHPUnit::assertArrayNotHasKey($key, $this->response->original->getData()); + + return $this; + } + + /** + * Assert whether the client was redirected to a given URI. + * + * @param string $uri + * @param array $with + * @return $this + */ + public function assertRedirectedTo($uri, $with = []) + { + PHPUnit::assertInstanceOf('Illuminate\Http\RedirectResponse', $this->response); + + PHPUnit::assertEquals($this->app['url']->to($uri), $this->response->headers->get('Location')); + + $this->assertSessionHasAll($with); + + return $this; + } + + /** + * Assert whether the client was redirected to a given route. + * + * @param string $name + * @param array $parameters + * @param array $with + * @return $this + */ + public function assertRedirectedToRoute($name, $parameters = [], $with = []) + { + return $this->assertRedirectedTo($this->app['url']->route($name, $parameters), $with); + } + + /** + * Assert whether the client was redirected to a given action. + * + * @param string $name + * @param array $parameters + * @param array $with + * @return $this + */ + public function assertRedirectedToAction($name, $parameters = [], $with = []) + { + return $this->assertRedirectedTo($this->app['url']->action($name, $parameters), $with); + } + /** * Dump the content from the last response. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php new file mode 100644 index 0000000..5cb7baf --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php @@ -0,0 +1,241 @@ +withoutEvents(); + + $this->beforeApplicationDestroyed(function () use ($events) { + $fired = $this->getFiredEvents($events); + + if ($eventsNotFired = array_diff($events, $fired)) { + throw new Exception( + 'These expected events were not fired: ['.implode(', ', $eventsNotFired).']' + ); + } + }); + + return $this; + } + + /** + * Specify a list of events that should not be fired for the given operation. + * + * These events will be mocked, so that handlers will not actually be executed. + * + * @param array|string $events + * @return $this + */ + public function doesntExpectEvents($events) + { + $events = is_array($events) ? $events : func_get_args(); + + $this->withoutEvents(); + + $this->beforeApplicationDestroyed(function () use ($events) { + if ($fired = $this->getFiredEvents($events)) { + throw new Exception( + 'These unexpected events were fired: ['.implode(', ', $fired).']' + ); + } + }); + + return $this; + } + + /** + * Mock the event dispatcher so all events are silenced and collected. + * + * @return $this + */ + protected function withoutEvents() + { + $mock = Mockery::mock('Illuminate\Contracts\Events\Dispatcher'); + + $mock->shouldReceive('fire')->andReturnUsing(function ($called) { + $this->firedEvents[] = $called; + }); + + $this->app->instance('events', $mock); + + return $this; + } + + /** + * Specify a list of observers that will not run for the given operation. + * + * @param array|string $observers + * @return $this + */ + public function withoutObservers($observers) + { + $observers = is_array($observers) ? $observers : [$observers]; + + array_map(function ($observer) { + $this->app->bind($observer, function () use ($observer) { + return $this->getMockBuilder($observer)->disableOriginalConstructor()->getMock(); + }); + }, $observers); + + return $this; + } + + /** + * Filter the given events against the fired events. + * + * @param array $events + * @return array + */ + protected function getFiredEvents(array $events) + { + return $this->getDispatched($events, $this->firedEvents); + } + + /** + * Specify a list of jobs that should be dispatched for the given operation. + * + * These jobs will be mocked, so that handlers will not actually be executed. + * + * @param array|string $jobs + * @return $this + */ + protected function expectsJobs($jobs) + { + $jobs = is_array($jobs) ? $jobs : func_get_args(); + + $this->withoutJobs(); + + $this->beforeApplicationDestroyed(function () use ($jobs) { + $dispatched = $this->getDispatchedJobs($jobs); + + if ($jobsNotDispatched = array_diff($jobs, $dispatched)) { + throw new Exception( + 'These expected jobs were not dispatched: ['.implode(', ', $jobsNotDispatched).']' + ); + } + }); + + return $this; + } + + /** + * Specify a list of jobs that should not be dispatched for the given operation. + * + * These jobs will be mocked, so that handlers will not actually be executed. + * + * @param array|string $jobs + * @return $this + */ + protected function doesntExpectJobs($jobs) + { + $jobs = is_array($jobs) ? $jobs : func_get_args(); + + $this->withoutJobs(); + + $this->beforeApplicationDestroyed(function () use ($jobs) { + if ($dispatched = $this->getDispatchedJobs($jobs)) { + throw new Exception( + 'These unexpected jobs were dispatched: ['.implode(', ', $dispatched).']' + ); + } + }); + + return $this; + } + + /** + * Mock the job dispatcher so all jobs are silenced and collected. + * + * @return $this + */ + protected function withoutJobs() + { + $mock = Mockery::mock('Illuminate\Contracts\Bus\Dispatcher'); + + $mock->shouldReceive('dispatch')->andReturnUsing(function ($dispatched) { + $this->dispatchedJobs[] = $dispatched; + }); + + $this->app->instance( + 'Illuminate\Contracts\Bus\Dispatcher', $mock + ); + + return $this; + } + + /** + * Filter the given jobs against the dispatched jobs. + * + * @param array $jobs + * @return array + */ + protected function getDispatchedJobs(array $jobs) + { + return $this->getDispatched($jobs, $this->dispatchedJobs); + } + + /** + * Filter the given classes against an array of dispatched classes. + * + * @param array $classes + * @param array $dispatched + * @return array + */ + protected function getDispatched(array $classes, array $dispatched) + { + return array_filter($classes, function ($class) use ($dispatched) { + return $this->wasDispatched($class, $dispatched); + }); + } + + /** + * Check if the given class exists in an array of dispatched classes. + * + * @param string $needle + * @param array $haystack + * @return bool + */ + protected function wasDispatched($needle, array $haystack) + { + foreach ($haystack as $dispatched) { + if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) || + $dispatched instanceof $needle) { + return true; + } + } + + return false; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/FormFieldConstraint.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/FormFieldConstraint.php new file mode 100644 index 0000000..89f513b --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/FormFieldConstraint.php @@ -0,0 +1,82 @@ +selector = $selector; + $this->value = (string) $value; + } + + /** + * Get the valid elements. + * + * Multiple elements should be separated by commas without spaces. + * + * @return string + */ + abstract protected function validElements(); + + /** + * Get the form field. + * + * @param \Symfony\Component\DomCrawler\Crawler $crawler + * @return \Symfony\Component\DomCrawler\Crawler + * + * @throws \PHPUnit_Framework_ExpectationFailedException + */ + protected function field(Crawler $crawler) + { + $field = $crawler->filter(implode(', ', $this->getElements())); + + if ($field->count() > 0) { + return $field; + } + + $this->fail($crawler, sprintf( + 'There is no %s with the name or ID [%s]', + $this->validElements(), $this->selector + )); + } + + /** + * Get the elements relevant to the selector. + * + * @return array + */ + protected function getElements() + { + $name = str_replace('#', '', $this->selector); + + $id = str_replace(['[', ']'], ['\\[', '\\]'], $name); + + return collect(explode(',', $this->validElements()))->map(function ($element) use ($name, $id) { + return "{$element}#{$id}, {$element}[name='{$name}']"; + })->all(); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasElement.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasElement.php new file mode 100644 index 0000000..de834b5 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasElement.php @@ -0,0 +1,99 @@ +selector = $selector; + $this->attributes = $attributes; + } + + /** + * Check if the element is found in the given crawler. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return bool + */ + public function matches($crawler) + { + $elements = $this->crawler($crawler)->filter($this->selector); + + if ($elements->count() == 0) { + return false; + } + + if (empty($this->attributes)) { + return true; + } + + $elements = $elements->reduce(function ($element) { + return $this->hasAttributes($element); + }); + + return $elements->count() > 0; + } + + /** + * Determines if the given element has the attributes. + * + * @param \Symfony\Component\DomCrawler\Crawler $element + * @return bool + */ + protected function hasAttributes(Crawler $element) + { + foreach ($this->attributes as $name => $value) { + if (is_numeric($name)) { + if ($element->attr($value) === null) { + return false; + } + } else { + if ($element->attr($name) != $value) { + return false; + } + } + } + + return true; + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + $message = "the element [{$this->selector}]"; + + if (! empty($this->attributes)) { + $message .= ' with the attributes '.json_encode($this->attributes); + } + + return $message; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInElement.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInElement.php new file mode 100644 index 0000000..032c799 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInElement.php @@ -0,0 +1,68 @@ +text = $text; + $this->element = $element; + } + + /** + * Check if the source or text is found within the element in the given crawler. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return bool + */ + public function matches($crawler) + { + $elements = $this->crawler($crawler)->filter($this->element); + + $pattern = $this->getEscapedPattern($this->text); + + foreach ($elements as $element) { + $element = new Crawler($element); + + if (preg_match("/$pattern/i", $element->html())) { + return true; + } + } + + return false; + } + + /** + * Returns the description of the failure. + * + * @return string + */ + protected function getFailureDescription() + { + return sprintf('[%s] contains %s', $this->element, $this->text); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasLink.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasLink.php new file mode 100644 index 0000000..5ccb7f2 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasLink.php @@ -0,0 +1,100 @@ + tag. + * + * @var string|null + */ + protected $url; + + /** + * Create a new constraint instance. + * + * @param string $text + * @param string|null $url + * @return void + */ + public function __construct($text, $url = null) + { + $this->url = $url; + $this->text = $text; + } + + /** + * Check if the link is found in the given crawler. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return bool + */ + public function matches($crawler) + { + $links = $this->crawler($crawler)->selectLink($this->text); + + if ($links->count() == 0) { + return false; + } + + // If the URL is null we assume the developer only wants to find a link + // with the given text regardless of the URL. So if we find the link + // we will return true. Otherwise, we will look for the given URL. + if ($this->url == null) { + return true; + } + + $absoluteUrl = $this->absoluteUrl(); + + foreach ($links as $link) { + $linkHref = $link->getAttribute('href'); + + if ($linkHref == $this->url || $linkHref == $absoluteUrl) { + return true; + } + } + + return false; + } + + /** + * Add a root if the URL is relative (helper method of the hasLink function). + * + * @return string + */ + protected function absoluteUrl() + { + if (! Str::startsWith($this->url, ['http', 'https'])) { + return URL::to($this->url); + } + + return $this->url; + } + + /** + * Returns the description of the failure. + * + * @return string + */ + public function getFailureDescription() + { + $description = "a link with the text [{$this->text}]"; + + if ($this->url) { + $description .= " and the URL [{$this->url}]"; + } + + return $description; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasSource.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasSource.php new file mode 100644 index 0000000..a6e348a --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasSource.php @@ -0,0 +1,47 @@ +source = $source; + } + + /** + * Check if the source is found in the given crawler. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return bool + */ + protected function matches($crawler) + { + $pattern = $this->getEscapedPattern($this->source); + + return preg_match("/$pattern/i", $this->html($crawler)); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return "the HTML [{$this->source}]"; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasText.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasText.php new file mode 100644 index 0000000..bd3faa1 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasText.php @@ -0,0 +1,47 @@ +text = $text; + } + + /** + * Check if the plain text is found in the given crawler. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return bool + */ + protected function matches($crawler) + { + $pattern = $this->getEscapedPattern($this->text); + + return preg_match("/$pattern/i", $this->text($crawler)); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return "the text [{$this->text}]"; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasValue.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasValue.php new file mode 100644 index 0000000..05629cf --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasValue.php @@ -0,0 +1,61 @@ +crawler($crawler); + + return $this->getInputOrTextAreaValue($crawler) == $this->value; + } + + /** + * Get the value of an input or textarea. + * + * @param \Symfony\Component\DomCrawler\Crawler $crawler + * @return string + * + * @throws \PHPUnit_Framework_ExpectationFailedException + */ + public function getInputOrTextAreaValue(Crawler $crawler) + { + $field = $this->field($crawler); + + return $field->nodeName() == 'input' + ? $field->attr('value') + : $field->text(); + } + + /** + * Return the description of the failure. + * + * @return string + */ + protected function getFailureDescription() + { + return sprintf( + 'the field [%s] contains the expected value [%s]', + $this->selector, $this->value + ); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsChecked.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsChecked.php new file mode 100644 index 0000000..b3ff83d --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsChecked.php @@ -0,0 +1,50 @@ +selector = $selector; + } + + /** + * Get the valid elements. + * + * @return string + */ + protected function validElements() + { + return "input[type='checkbox']"; + } + + /** + * Determine if the checkbox is checked. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return bool + */ + public function matches($crawler) + { + $crawler = $this->crawler($crawler); + + return $this->field($crawler)->attr('checked') !== null; + } + + /** + * Return the description of the failure. + * + * @return string + */ + protected function getFailureDescription() + { + return "the checkbox [{$this->selector}] is checked"; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsSelected.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsSelected.php new file mode 100644 index 0000000..f1c012a --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/IsSelected.php @@ -0,0 +1,117 @@ +crawler($crawler); + + return in_array($this->value, $this->getSelectedValue($crawler)); + } + + /** + * Get the selected value of a select field or radio group. + * + * @param \Symfony\Component\DomCrawler\Crawler $crawler + * @return array + * + * @throws \PHPUnit_Framework_ExpectationFailedException + */ + public function getSelectedValue(Crawler $crawler) + { + $field = $this->field($crawler); + + return $field->nodeName() == 'select' + ? $this->getSelectedValueFromSelect($field) + : [$this->getCheckedValueFromRadioGroup($field)]; + } + + /** + * Get the selected value from a select field. + * + * @param \Symfony\Component\DomCrawler\Crawler $select + * @return array + */ + protected function getSelectedValueFromSelect(Crawler $select) + { + $selected = []; + + foreach ($select->children() as $option) { + if ($option->nodeName === 'optgroup') { + foreach ($option->childNodes as $child) { + if ($child->hasAttribute('selected')) { + $selected[] = $this->getOptionValue($child); + } + } + } elseif ($option->hasAttribute('selected')) { + $selected[] = $this->getOptionValue($option); + } + } + + return $selected; + } + + /** + * Get the selected value from an option element. + * + * @param \DOMElement $option + * @return string + */ + protected function getOptionValue(DOMElement $option) + { + if ($option->hasAttribute('value')) { + return $option->getAttribute('value'); + } + + return $option->textContent; + } + + /** + * Get the checked value from a radio group. + * + * @param \Symfony\Component\DomCrawler\Crawler $radioGroup + * @return string|null + */ + protected function getCheckedValueFromRadioGroup(Crawler $radioGroup) + { + foreach ($radioGroup as $radio) { + if ($radio->hasAttribute('checked')) { + return $radio->getAttribute('value'); + } + } + } + + /** + * Returns the description of the failure. + * + * @return string + */ + protected function getFailureDescription() + { + return sprintf( + 'the element [%s] has the selected value [%s]', + $this->selector, $this->value + ); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/PageConstraint.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/PageConstraint.php new file mode 100644 index 0000000..f331c85 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/PageConstraint.php @@ -0,0 +1,114 @@ +html() : $crawler; + } + + /** + * Make sure we obtain the HTML from the crawler or the response. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return string + */ + protected function text($crawler) + { + return is_object($crawler) ? $crawler->text() : strip_tags($crawler); + } + + /** + * Create a crawler instance if the given value is not already a Crawler. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @return \Symfony\Component\DomCrawler\Crawler + */ + protected function crawler($crawler) + { + return is_object($crawler) ? $crawler : new Crawler($crawler); + } + + /** + * Get the escaped text pattern for the constraint. + * + * @param string $text + * @return string + */ + protected function getEscapedPattern($text) + { + $rawPattern = preg_quote($text, '/'); + + $escapedPattern = preg_quote(e($text), '/'); + + return $rawPattern == $escapedPattern + ? $rawPattern : "({$rawPattern}|{$escapedPattern})"; + } + + /** + * Throw an exception for the given comparison and test description. + * + * @param \Symfony\Component\DomCrawler\Crawler|string $crawler + * @param string $description + * @param \SebastianBergmann\Comparator\ComparisonFailure|null $comparisonFailure + * @return void + * + * @throws \PHPUnit_Framework_ExpectationFailedException + */ + protected function fail($crawler, $description, ComparisonFailure $comparisonFailure = null) + { + $html = $this->html($crawler); + + $failureDescription = sprintf( + "%s\n\n\nFailed asserting that %s", + $html, $this->getFailureDescription() + ); + + if (! empty($description)) { + $failureDescription .= ": $description"; + } + + if (trim($html) != '') { + $failureDescription .= '. Please check the content above.'; + } else { + $failureDescription .= '. The response is empty.'; + } + + throw new FailedExpection($failureDescription, $comparisonFailure); + } + + /** + * Get the description of the failure. + * + * @return string + */ + protected function getFailureDescription() + { + return 'the page contains '.$this->toString(); + } + + /** + * Get a string representation of the object. + * + * Placeholder method to avoid forcing definition of this method. + * + * @return string + */ + public function toString() + { + return ''; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/ReversePageConstraint.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/ReversePageConstraint.php new file mode 100644 index 0000000..2b0f3c4 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/ReversePageConstraint.php @@ -0,0 +1,61 @@ +pageConstraint = $pageConstraint; + } + + /** + * Reverse the original page constraint result. + * + * @param \Symfony\Component\DomCrawler\Crawler $crawler + * @return bool + */ + public function matches($crawler) + { + return ! $this->pageConstraint->matches($crawler); + } + + /** + * Get the description of the failure. + * + * This method will attempt to negate the original description. + * + * @return string + */ + protected function getFailureDescription() + { + return str_replace( + ['contains', 'is', 'has'], + ['does not contain', 'is not', 'does not have'], + $this->pageConstraint->getFailureDescription() + ); + } + + /** + * Get a string representation of the object. + * + * @return string + */ + public function toString() + { + return $this->pageConstraint->toString(); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php index d53b34e..e9e9533 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php @@ -5,7 +5,9 @@ trait DatabaseMigrations { /** - * @before + * Define hooks to migrate the database before and after each test. + * + * @return void */ public function runDatabaseMigrations() { diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php index e580f5a..becee74 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php @@ -5,14 +5,33 @@ trait DatabaseTransactions { /** - * @before + * Handle database transactions on the specified connections. + * + * @return void */ public function beginDatabaseTransaction() { - $this->app->make('db')->beginTransaction(); + $database = $this->app->make('db'); - $this->beforeApplicationDestroyed(function () { - $this->app->make('db')->rollBack(); + foreach ($this->connectionsToTransact() as $name) { + $database->connection($name)->beginTransaction(); + } + + $this->beforeApplicationDestroyed(function () use ($database) { + foreach ($this->connectionsToTransact() as $name) { + $database->connection($name)->rollBack(); + } }); } + + /** + * The database connections that should have transactions. + * + * @return array + */ + protected function connectionsToTransact() + { + return property_exists($this, 'connectionsToTransact') + ? $this->connectionsToTransact : [null]; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php old mode 100644 new mode 100755 index ffbbfae..82b1f28 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php @@ -7,7 +7,28 @@ abstract class TestCase extends PHPUnit_Framework_TestCase { - use ApplicationTrait, AssertionsTrait, CrawlerTrait; + use Concerns\InteractsWithContainer, + Concerns\MakesHttpRequests, + Concerns\ImpersonatesUsers, + Concerns\InteractsWithAuthentication, + Concerns\InteractsWithConsole, + Concerns\InteractsWithDatabase, + Concerns\InteractsWithSession, + Concerns\MocksApplicationServices; + + /** + * The Illuminate application instance. + * + * @var \Illuminate\Foundation\Application + */ + protected $app; + + /** + * The callbacks that should be run after the application is created. + * + * @var array + */ + protected $afterApplicationCreatedCallbacks = []; /** * The callbacks that should be run before the application is destroyed. @@ -16,6 +37,13 @@ abstract class TestCase extends PHPUnit_Framework_TestCase */ protected $beforeApplicationDestroyedCallbacks = []; + /** + * Indicates if we have made it through the base setUp function. + * + * @var bool + */ + protected $setUpHasRun = false; + /** * Creates the application. * @@ -30,11 +58,57 @@ abstract public function createApplication(); * * @return void */ - public function setUp() + protected function setUp() { if (! $this->app) { $this->refreshApplication(); } + + $this->setUpTraits(); + + foreach ($this->afterApplicationCreatedCallbacks as $callback) { + call_user_func($callback); + } + + $this->setUpHasRun = true; + } + + /** + * Refresh the application instance. + * + * @return void + */ + protected function refreshApplication() + { + putenv('APP_ENV=testing'); + + $this->app = $this->createApplication(); + } + + /** + * Boot the testing helper traits. + * + * @return void + */ + protected function setUpTraits() + { + $uses = array_flip(class_uses_recursive(static::class)); + + if (isset($uses[DatabaseMigrations::class])) { + $this->runDatabaseMigrations(); + } + + if (isset($uses[DatabaseTransactions::class])) { + $this->beginDatabaseTransaction(); + } + + if (isset($uses[WithoutMiddleware::class])) { + $this->disableMiddlewareForAllTests(); + } + + if (isset($uses[WithoutEvents::class])) { + $this->disableEventsForAllTests(); + } } /** @@ -42,7 +116,7 @@ public function setUp() * * @return void */ - public function tearDown() + protected function tearDown() { if ($this->app) { foreach ($this->beforeApplicationDestroyedCallbacks as $callback) { @@ -54,6 +128,8 @@ public function tearDown() $this->app = null; } + $this->setUpHasRun = false; + if (property_exists($this, 'serverVariables')) { $this->serverVariables = []; } @@ -61,6 +137,24 @@ public function tearDown() if (class_exists('Mockery')) { Mockery::close(); } + + $this->afterApplicationCreatedCallbacks = []; + $this->beforeApplicationDestroyedCallbacks = []; + } + + /** + * Register a callback to be run after the application is created. + * + * @param callable $callback + * @return void + */ + protected function afterApplicationCreated(callable $callback) + { + $this->afterApplicationCreatedCallbacks[] = $callback; + + if ($this->setUpHasRun) { + call_user_func($callback); + } } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutEvents.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutEvents.php index 80bf471..7837a74 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutEvents.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutEvents.php @@ -7,7 +7,9 @@ trait WithoutEvents { /** - * @before + * Prevent all event handles from being executed. + * + * @throws \Exception */ public function disableEventsForAllTests() { diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddleware.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddleware.php index 91d1bf5..a5d2f69 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddleware.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddleware.php @@ -7,7 +7,9 @@ trait WithoutMiddleware { /** - * @before + * Prevent all middleware from being executed for this test class. + * + * @throws \Exception */ public function disableMiddlewareForAllTests() { diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php index c3f896b..4173027 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php @@ -7,7 +7,6 @@ use Illuminate\Routing\UrlGenerator; use Illuminate\Contracts\Validation\Factory; use Illuminate\Contracts\Validation\Validator; -use Illuminate\Http\Exception\HttpResponseException; trait ValidatesRequests { @@ -18,6 +17,26 @@ trait ValidatesRequests */ protected $validatesRequestErrorBag; + /** + * Run the validation routine against the given validator. + * + * @param \Illuminate\Contracts\Validation\Validator|array $validator + * @param \Illuminate\Http\Request|null $request + * @return void + */ + public function validateWith($validator, Request $request = null) + { + $request = $request ?: app('request'); + + if (is_array($validator)) { + $validator = $this->getValidationFactory()->make($request->all(), $validator); + } + + if ($validator->fails()) { + $this->throwValidationException($request, $validator); + } + } + /** * Validate the given request with the given rules. * @@ -26,8 +45,6 @@ trait ValidatesRequests * @param array $messages * @param array $customAttributes * @return void - * - * @throws \Illuminate\Http\Exception\HttpResponseException */ public function validate(Request $request, array $rules, array $messages = [], array $customAttributes = []) { @@ -48,7 +65,7 @@ public function validate(Request $request, array $rules, array $messages = [], a * @param array $customAttributes * @return void * - * @throws \Illuminate\Http\Exception\HttpResponseException + * @throws \Illuminate\Foundation\Validation\ValidationException */ public function validateWithBag($errorBag, Request $request, array $rules, array $messages = [], array $customAttributes = []) { @@ -64,11 +81,11 @@ public function validateWithBag($errorBag, Request $request, array $rules, array * @param \Illuminate\Contracts\Validation\Validator $validator * @return void * - * @throws \Illuminate\Http\Exception\HttpResponseException + * @throws \Illuminate\Foundation\Validation\ValidationException */ protected function throwValidationException(Request $request, $validator) { - throw new HttpResponseException($this->buildFailedValidationResponse( + throw new ValidationException($validator, $this->buildFailedValidationResponse( $request, $this->formatValidationErrors($validator) )); } @@ -82,7 +99,7 @@ protected function throwValidationException(Request $request, $validator) */ protected function buildFailedValidationResponse(Request $request, array $errors) { - if ($request->ajax() || $request->wantsJson()) { + if (($request->ajax() && ! $request->pjax()) || $request->wantsJson()) { return new JsonResponse($errors, 422); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidationException.php b/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidationException.php new file mode 100644 index 0000000..1f3e4c3 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidationException.php @@ -0,0 +1,12 @@ +guard($guard); + } } } @@ -209,11 +257,11 @@ function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain /** * Generate a CSRF token form field. * - * @return string + * @return \Illuminate\Support\HtmlString */ function csrf_field() { - return new Expression(''); + return new HtmlString(''); } } @@ -223,7 +271,7 @@ function csrf_field() * * @return string * - * @throws RuntimeException + * @throws \RuntimeException */ function csrf_token() { @@ -250,17 +298,16 @@ function database_path($path = '') } } -if (! function_exists('delete')) { +if (! function_exists('decrypt')) { /** - * Register a new DELETE route with the router. + * Decrypt the given value. * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route + * @param string $value + * @return string */ - function delete($uri, $action) + function decrypt($value) { - return app('router')->delete($uri, $action); + return app('encrypter')->decrypt($value); } } @@ -282,26 +329,43 @@ function dispatch($job) * Get the path to a versioned Elixir file. * * @param string $file + * @param string $buildDirectory * @return string * * @throws \InvalidArgumentException */ - function elixir($file) + function elixir($file, $buildDirectory = 'build') { - static $manifest = null; + static $manifest; + static $manifestPath; + + if (is_null($manifest) || $manifestPath !== $buildDirectory) { + $manifest = json_decode(file_get_contents(public_path($buildDirectory.'/rev-manifest.json')), true); - if (is_null($manifest)) { - $manifest = json_decode(file_get_contents(public_path('build/rev-manifest.json')), true); + $manifestPath = $buildDirectory; } if (isset($manifest[$file])) { - return '/build/'.$manifest[$file]; + return '/'.trim($buildDirectory.'/'.$manifest[$file], '/'); } throw new InvalidArgumentException("File {$file} not defined in asset manifest."); } } +if (! function_exists('encrypt')) { + /** + * Encrypt the given value. + * + * @param string $value + * @return string + */ + function encrypt($value) + { + return app('encrypter')->encrypt($value); + } +} + if (! function_exists('env')) { /** * Gets the value of an environment variable. Supports boolean, empty and null. @@ -379,20 +443,6 @@ function factory() } } -if (! function_exists('get')) { - /** - * Register a new GET route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - function get($uri, $action) - { - return app('router')->get($uri, $action); - } -} - if (! function_exists('info')) { /** * Write some information to the log. @@ -413,7 +463,7 @@ function info($message, $context = []) * * @param string $message * @param array $context - * @return null|\Illuminate\Contracts\Logging\Log + * @return \Illuminate\Contracts\Logging\Log|null */ function logger($message = null, array $context = []) { @@ -430,11 +480,11 @@ function logger($message = null, array $context = []) * Generate a form field to spoof the HTTP verb used by forms. * * @param string $method - * @return string + * @return \Illuminate\Support\HtmlString */ function method_field($method) { - return new Expression(''); + return new HtmlString(''); } } @@ -452,20 +502,6 @@ function old($key = null, $default = null) } } -if (! function_exists('patch')) { - /** - * Register a new PATCH route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - function patch($uri, $action) - { - return app('router')->patch($uri, $action); - } -} - if (! function_exists('policy')) { /** * Get a policy instance for a given class. @@ -481,20 +517,6 @@ function policy($class) } } -if (! function_exists('post')) { - /** - * Register a new POST route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - function post($uri, $action) - { - return app('router')->post($uri, $action); - } -} - if (! function_exists('public_path')) { /** * Get the path to the public folder. @@ -508,20 +530,6 @@ function public_path($path = '') } } -if (! function_exists('put')) { - /** - * Register a new PUT route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - function put($uri, $action) - { - return app('router')->put($uri, $action); - } -} - if (! function_exists('redirect')) { /** * Get an instance of the redirector. @@ -560,18 +568,16 @@ function request($key = null, $default = null) } } -if (! function_exists('resource')) { +if (! function_exists('resource_path')) { /** - * Route a resource to a controller. + * Get the path to the resources folder. * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route + * @param string $path + * @return string */ - function resource($name, $controller, array $options = []) + function resource_path($path = '') { - return app('router')->resource($name, $controller, $options); + return app()->basePath().DIRECTORY_SEPARATOR.'resources'.($path ? DIRECTORY_SEPARATOR.$path : $path); } } @@ -603,12 +609,11 @@ function response($content = '', $status = 200, array $headers = []) * @param string $name * @param array $parameters * @param bool $absolute - * @param \Illuminate\Routing\Route $route * @return string */ - function route($name, $parameters = [], $absolute = true, $route = null) + function route($name, $parameters = [], $absolute = true) { - return app('url')->route($name, $parameters, $absolute, $route); + return app('url')->route($name, $parameters, $absolute); } } @@ -684,7 +689,7 @@ function storage_path($path = '') * @param array $parameters * @param string $domain * @param string $locale - * @return string + * @return \Symfony\Component\Translation\TranslatorInterface|string */ function trans($id = null, $parameters = [], $domain = 'messages', $locale = null) { @@ -701,7 +706,7 @@ function trans($id = null, $parameters = [], $domain = 'messages', $locale = nul * Translates the given message based on a count. * * @param string $id - * @param int $number + * @param int|array|\Countable $number * @param array $parameters * @param string $domain * @param string $locale @@ -720,14 +725,40 @@ function trans_choice($id, $number, array $parameters = [], $domain = 'messages' * @param string $path * @param mixed $parameters * @param bool $secure - * @return string + * @return Illuminate\Contracts\Routing\UrlGenerator|string */ function url($path = null, $parameters = [], $secure = null) { + if (is_null($path)) { + return app(UrlGenerator::class); + } + return app(UrlGenerator::class)->to($path, $parameters, $secure); } } +if (! function_exists('validator')) { + /** + * Create a new Validator instance. + * + * @param array $data + * @param array $rules + * @param array $messages + * @param array $customAttributes + * @return \Illuminate\Contracts\Validation\Validator + */ + function validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = []) + { + $factory = app(ValidationFactory::class); + + if (func_num_args() === 0) { + return $factory; + } + + return $factory->make($data, $rules, $messages, $customAttributes); + } +} + if (! function_exists('view')) { /** * Get the evaluated view contents for the given view. diff --git a/application/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php b/application/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Hashing/composer.json b/application/vendor/laravel/framework/src/Illuminate/Hashing/composer.json old mode 100644 new mode 100755 index d2ccf86..17e692a --- a/application/vendor/laravel/framework/src/Illuminate/Hashing/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Hashing/composer.json @@ -10,13 +10,13 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php b/application/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php old mode 100644 new mode 100755 index 09d71ef..7d5ff2b --- a/application/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php +++ b/application/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php @@ -2,20 +2,16 @@ namespace Illuminate\Http; +use JsonSerializable; +use InvalidArgumentException; use Illuminate\Contracts\Support\Jsonable; +use Illuminate\Contracts\Support\Arrayable; use Symfony\Component\HttpFoundation\JsonResponse as BaseJsonResponse; class JsonResponse extends BaseJsonResponse { use ResponseTrait; - /** - * The json encoding options. - * - * @var int - */ - protected $jsonOptions; - /** * Constructor. * @@ -26,7 +22,7 @@ class JsonResponse extends BaseJsonResponse */ public function __construct($data = null, $status = 200, $headers = [], $options = 0) { - $this->jsonOptions = $options; + $this->encodingOptions = $options; parent::__construct($data, $status, $headers); } @@ -48,9 +44,19 @@ public function getData($assoc = false, $depth = 512) */ public function setData($data = []) { - $this->data = $data instanceof Jsonable - ? $data->toJson($this->jsonOptions) - : json_encode($data, $this->jsonOptions); + if ($data instanceof Arrayable) { + $this->data = json_encode($data->toArray(), $this->encodingOptions); + } elseif ($data instanceof Jsonable) { + $this->data = $data->toJson($this->encodingOptions); + } elseif ($data instanceof JsonSerializable) { + $this->data = json_encode($data->jsonSerialize(), $this->encodingOptions); + } else { + $this->data = json_encode($data, $this->encodingOptions); + } + + if (JSON_ERROR_NONE !== json_last_error()) { + throw new InvalidArgumentException(json_last_error_msg()); + } return $this->update(); } @@ -62,7 +68,15 @@ public function setData($data = []) */ public function getJsonOptions() { - return $this->jsonOptions; + return $this->getEncodingOptions(); + } + + /** + * {@inheritdoc} + */ + public function setEncodingOptions($encodingOptions) + { + return $this->setJsonOptions($encodingOptions); } /** @@ -73,7 +87,7 @@ public function getJsonOptions() */ public function setJsonOptions($options) { - $this->jsonOptions = $options; + $this->encodingOptions = (int) $options; return $this->setData($this->getData()); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php b/application/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/Request.php b/application/vendor/laravel/framework/src/Illuminate/Http/Request.php index eaa382b..fa6b7db 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Http/Request.php +++ b/application/vendor/laravel/framework/src/Illuminate/Http/Request.php @@ -8,11 +8,15 @@ use RuntimeException; use Illuminate\Support\Arr; use Illuminate\Support\Str; +use Illuminate\Support\Traits\Macroable; +use Illuminate\Contracts\Support\Arrayable; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request as SymfonyRequest; -class Request extends SymfonyRequest implements ArrayAccess +class Request extends SymfonyRequest implements Arrayable, ArrayAccess { + use Macroable; + /** * The decoded JSON content for the request. * @@ -20,6 +24,13 @@ class Request extends SymfonyRequest implements ArrayAccess */ protected $json; + /** + * All of the converted files for the request. + * + * @var array + */ + protected $convertedFiles; + /** * The user resolver callback. * @@ -95,7 +106,22 @@ public function fullUrl() { $query = $this->getQueryString(); - return $query ? $this->url().'?'.$query : $this->url(); + $question = $this->getBaseUrl().$this->getPathInfo() == '/' ? '/?' : '?'; + + return $query ? $this->url().$question.$query : $this->url(); + } + + /** + * Get the full URL for the request with the added query string parameters. + * + * @param array $query + * @return string + */ + public function fullUrlWithQuery(array $query) + { + return count($this->query()) > 0 + ? $this->url().'/?'.http_build_query(array_merge($this->query(), $query)) + : $this->fullUrl().'?'.http_build_query($query); } /** @@ -163,6 +189,25 @@ public function is() return false; } + /** + * Determine if the current request URL and query string matches a pattern. + * + * @param mixed string + * @return bool + */ + public function fullUrlIs() + { + $url = $this->fullUrl(); + + foreach (func_get_args() as $pattern) { + if (Str::is($pattern, $url)) { + return true; + } + } + + return false; + } + /** * Determine if the request is the result of an AJAX call. * @@ -226,7 +271,7 @@ public function exists($key) $input = $this->all(); foreach ($keys as $value) { - if (! array_key_exists($value, $input)) { + if (! Arr::has($input, $value)) { return false; } } @@ -275,7 +320,7 @@ protected function isEmptyString($key) */ public function all() { - return array_replace_recursive($this->input(), $this->files->all()); + return array_replace_recursive($this->input(), $this->allFiles()); } /** @@ -289,13 +334,13 @@ public function input($key = null, $default = null) { $input = $this->getInputSource()->all() + $this->query->all(); - return Arr::get($input, $key, $default); + return data_get($input, $key, $default); } /** - * Get a subset of the items from the input data. + * Get a subset containing the provided keys with values from the input data. * - * @param array $keys + * @param array|mixed $keys * @return array */ public function only($keys) @@ -307,7 +352,7 @@ public function only($keys) $input = $this->all(); foreach ($keys as $key) { - Arr::set($results, $key, Arr::get($input, $key)); + Arr::set($results, $key, data_get($input, $key)); } return $results; @@ -330,6 +375,17 @@ public function except($keys) return $results; } + /** + * Intersect an array of items with the input data. + * + * @param array|mixed $keys + * @return array + */ + public function intersect($keys) + { + return array_filter($this->only(is_array($keys) ? $keys : func_get_args())); + } + /** * Retrieve a query string item from the request. * @@ -365,16 +421,49 @@ public function cookie($key = null, $default = null) return $this->retrieveItem('cookies', $key, $default); } + /** + * Get an array of all of the files on the request. + * + * @return array + */ + public function allFiles() + { + $files = $this->files->all(); + + return $this->convertedFiles + ? $this->convertedFiles + : $this->convertedFiles = $this->convertUploadedFiles($files); + } + + /** + * Convert the given array of Symfony UploadedFiles to custom Laravel UploadedFiles. + * + * @param array $files + * @return array + */ + protected function convertUploadedFiles(array $files) + { + return array_map(function ($file) { + if (is_null($file) || (is_array($file) && empty(array_filter($file)))) { + return $file; + } + + return is_array($file) + ? $this->convertUploadedFiles($file) + : UploadedFile::createFromBase($file); + }, $files); + } + /** * Retrieve a file from the request. * * @param string $key * @param mixed $default - * @return \Symfony\Component\HttpFoundation\File\UploadedFile|array|null + * @return \Illuminate\Http\UploadedFile|array|null */ public function file($key = null, $default = null) { - return Arr::get($this->files->all(), $key, $default); + return data_get($this->allFiles(), $key, $default); } /** @@ -409,6 +498,17 @@ protected function isValidFile($file) return $file instanceof SplFileInfo && $file->getPath() != ''; } + /** + * Determine if a header is set on the request. + * + * @param string $key + * @return bool + */ + public function hasHeader($key) + { + return ! is_null($this->header($key)); + } + /** * Retrieve a header from the request. * @@ -509,7 +609,7 @@ protected function retrieveItem($source, $key, $default) return $this->$source->all(); } - return $this->$source->get($key, $default, true); + return $this->$source->get($key, $default); } /** @@ -551,7 +651,7 @@ public function json($key = null, $default = null) return $this->json; } - return Arr::get($this->json->all(), $key, $default); + return data_get($this->json->all(), $key, $default); } /** @@ -565,7 +665,7 @@ protected function getInputSource() return $this->json(); } - return $this->getRealMethod() == 'GET' ? $this->query : $this->request; + return $this->getMethod() == 'GET' ? $this->query : $this->request; } /** @@ -707,6 +807,20 @@ public function format($default = 'html') return $default; } + /** + * Get the bearer token from the request headers. + * + * @return string|null + */ + public function bearerToken() + { + $header = $this->header('Authorization', ''); + + if (Str::startsWith($header, 'Bearer ')) { + return Str::substr($header, 7); + } + } + /** * Create an Illuminate request from a Symfony instance. * @@ -762,11 +876,12 @@ public function session() /** * Get the user making the request. * + * @param string|null $guard * @return mixed */ - public function user() + public function user($guard = null) { - return call_user_func($this->getUserResolver()); + return call_user_func($this->getUserResolver(), $guard); } /** @@ -787,6 +902,27 @@ public function route($param = null) } } + /** + * Get a unique fingerprint for the request / route / IP address. + * + * @return string + * + * @throws \RuntimeException + */ + public function fingerprint() + { + if (! $this->route()) { + throw new RuntimeException('Unable to generate fingerprint. Route unavailable.'); + } + + return sha1( + implode('|', $this->route()->methods()). + '|'.$this->route()->domain(). + '|'.$this->route()->uri(). + '|'.$this->ip() + ); + } + /** * Get the user resolver callback. * @@ -837,6 +973,16 @@ public function setRouteResolver(Closure $callback) return $this; } + /** + * Get all of the input and files for the request. + * + * @return array + */ + public function toArray() + { + return $this->all(); + } + /** * Determine if the given offset exists. * @@ -856,7 +1002,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return Arr::get($this->all(), $offset); + return data_get($this->all(), $offset); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/Response.php b/application/vendor/laravel/framework/src/Illuminate/Http/Response.php old mode 100644 new mode 100755 index 3c9299d..078e48f --- a/application/vendor/laravel/framework/src/Illuminate/Http/Response.php +++ b/application/vendor/laravel/framework/src/Illuminate/Http/Response.php @@ -2,7 +2,9 @@ namespace Illuminate\Http; +use Exception; use ArrayObject; +use JsonSerializable; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Support\Renderable; use Symfony\Component\HttpFoundation\Response as BaseResponse; @@ -79,6 +81,7 @@ protected function shouldBeJson($content) { return $content instanceof Jsonable || $content instanceof ArrayObject || + $content instanceof JsonSerializable || is_array($content); } @@ -91,4 +94,17 @@ public function getOriginalContent() { return $this->original; } + + /** + * Set the exception to attach to the response. + * + * @param \Exception $e + * @return $this + */ + public function withException(Exception $e) + { + $this->exception = $e; + + return $this; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php b/application/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php index 56ddc6a..a4b23fa 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php +++ b/application/vendor/laravel/framework/src/Illuminate/Http/ResponseTrait.php @@ -2,6 +2,8 @@ namespace Illuminate\Http; +use Illuminate\Http\Exception\HttpResponseException; + trait ResponseTrait { /** @@ -39,6 +41,32 @@ public function header($key, $value, $replace = true) return $this; } + /** + * Add an array of headers to the response. + * + * @param array $headers + * @return $this + */ + public function withHeaders(array $headers) + { + foreach ($headers as $key => $value) { + $this->headers->set($key, $value); + } + + return $this; + } + + /** + * Add a cookie to the response. + * + * @param \Symfony\Component\HttpFoundation\Cookie|mixed $cookie + * @return $this + */ + public function cookie($cookie) + { + return call_user_func_array([$this, 'withCookie'], func_get_args()); + } + /** * Add a cookie to the response. * @@ -55,4 +83,14 @@ public function withCookie($cookie) return $this; } + + /** + * Throws the response in a HttpResponseException instance. + * + * @throws \Illuminate\Http\Exception\HttpResponseException + */ + public function throwResponse() + { + throw new HttpResponseException($this); + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php b/application/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php new file mode 100644 index 0000000..4df1ff8 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php @@ -0,0 +1,75 @@ +getRealPath(); + } + + /** + * Get the file's extension. + * + * @return string + */ + public function extension() + { + return $this->guessExtension(); + } + + /** + * Get the file's extension supplied by the client. + * + * @return string + */ + public function clientExtension() + { + return $this->guessClientExtension(); + } + + /** + * Get a filename for the file that is the MD5 hash of the contents. + * + * @param string $path + * @return string + */ + public function hashName($path = null) + { + if ($path) { + $path = rtrim($path, '/').'/'; + } + + return $path.md5_file($this->path()).'.'.$this->extension(); + } + + /** + * Create a new file instance from a base instance. + * + * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file + * @param bool $test + * @return static + */ + public static function createFromBase(SymfonyUploadedFile $file, $test = false) + { + return $file instanceof static ? $file : new static( + $file->getPathname(), + $file->getClientOriginalName(), + $file->getClientMimeType(), + $file->getClientSize(), + $file->getError(), + $test + ); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Http/composer.json b/application/vendor/laravel/framework/src/Illuminate/Http/composer.json old mode 100644 new mode 100755 index a7bb6d3..706a9ef --- a/application/vendor/laravel/framework/src/Illuminate/Http/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Http/composer.json @@ -10,15 +10,15 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/session": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/http-foundation": "2.7.*", - "symfony/http-kernel": "2.7.*" + "illuminate/session": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/http-kernel": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Log/Writer.php b/application/vendor/laravel/framework/src/Illuminate/Log/Writer.php old mode 100644 new mode 100755 index ae386d1..7dbfbab --- a/application/vendor/laravel/framework/src/Illuminate/Log/Writer.php +++ b/application/vendor/laravel/framework/src/Illuminate/Log/Writer.php @@ -5,11 +5,11 @@ use Closure; use RuntimeException; use InvalidArgumentException; -use Monolog\Handler\StreamHandler; use Monolog\Handler\SyslogHandler; +use Monolog\Handler\StreamHandler; +use Monolog\Logger as MonologLogger; use Monolog\Formatter\LineFormatter; use Monolog\Handler\ErrorLogHandler; -use Monolog\Logger as MonologLogger; use Monolog\Handler\RotatingFileHandler; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Contracts\Events\Dispatcher; @@ -343,7 +343,7 @@ public function getMonolog() } /** - * Get a defaut Monolog formatter instance. + * Get a default Monolog formatter instance. * * @return \Monolog\Formatter\LineFormatter */ diff --git a/application/vendor/laravel/framework/src/Illuminate/Log/composer.json b/application/vendor/laravel/framework/src/Illuminate/Log/composer.json old mode 100644 new mode 100755 index f5bfc36..0236388 --- a/application/vendor/laravel/framework/src/Illuminate/Log/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Log/composer.json @@ -10,13 +10,13 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", "monolog/monolog": "~1.11" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php b/application/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php new file mode 100644 index 0000000..17bc257 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php @@ -0,0 +1,24 @@ +message = $message; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php old mode 100644 new mode 100755 index afb5e4b..75eb304 --- a/application/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php @@ -48,13 +48,6 @@ public function register() $mailer->alwaysTo($to['address'], $to['name']); } - // Here we will determine if the mailer should be in "pretend" mode for this - // environment, which will simply write out e-mail to the logs instead of - // sending it over the web, which is useful for local dev environments. - $pretend = $app['config']->get('mail.pretend', false); - - $mailer->pretend($pretend); - return $mailer; }); } @@ -70,10 +63,6 @@ protected function setMailerDependencies($mailer, $app) { $mailer->setContainer($app); - if ($app->bound('Psr\Log\LoggerInterface')) { - $mailer->setLogger($app->make('Psr\Log\LoggerInterface')); - } - if ($app->bound('queue')) { $mailer->setQueue($app['queue.connection']); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php b/application/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php old mode 100644 new mode 100755 index 1292a97..9e3ef91 --- a/application/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php @@ -7,7 +7,6 @@ use Swift_Message; use Illuminate\Support\Arr; use Illuminate\Support\Str; -use Psr\Log\LoggerInterface; use SuperClosure\Serializer; use InvalidArgumentException; use Illuminate\Contracts\View\Factory; @@ -48,11 +47,11 @@ class Mailer implements MailerContract, MailQueueContract protected $from; /** - * The log writer instance. + * The global to address and name. * - * @var \Psr\Log\LoggerInterface + * @var array */ - protected $logger; + protected $to; /** * The IoC container instance. @@ -68,13 +67,6 @@ class Mailer implements MailerContract, MailQueueContract */ protected $queue; - /** - * Indicates if the actual sending is disabled. - * - * @var bool - */ - protected $pretending = false; - /** * Array of failed recipients. * @@ -126,7 +118,7 @@ public function alwaysTo($address, $name = null) * * @param string $text * @param mixed $callback - * @return int + * @return void */ public function raw($text, $callback) { @@ -139,7 +131,7 @@ public function raw($text, $callback) * @param string $view * @param array $data * @param mixed $callback - * @return int + * @return void */ public function plain($view, array $data, $callback) { @@ -260,8 +252,8 @@ public function laterOn($queue, $delay, $view, array $data, $callback) /** * Build the callable for a queued e-mail job. * - * @param mixed $callback - * @return mixed + * @param \Closure|string $callback + * @return string */ protected function buildQueueCallable($callback) { @@ -290,12 +282,12 @@ public function handleQueuedMessage($job, $data) * Get the true callable for a queued e-mail message. * * @param array $data - * @return mixed + * @return \Closure|string */ protected function getQueuedCallable(array $data) { if (Str::contains($data['callback'], 'SerializableClosure')) { - return unserialize($data['callback'])->getClosure(); + return (new Serializer)->unserialize($data['callback']); } return $data['callback']; @@ -386,33 +378,16 @@ protected function parseView($view) protected function sendSwiftMessage($message) { if ($this->events) { - $this->events->fire('mailer.sending', [$message]); + $this->events->fire(new Events\MessageSending($message)); } - if (! $this->pretending) { - try { - return $this->swift->send($message, $this->failedRecipients); - } finally { - $this->swift->getTransport()->stop(); - } - } elseif (isset($this->logger)) { - $this->logMessage($message); + try { + return $this->swift->send($message, $this->failedRecipients); + } finally { + $this->swift->getTransport()->stop(); } } - /** - * Log that a message was sent. - * - * @param \Swift_Message $message - * @return void - */ - protected function logMessage($message) - { - $emails = implode(', ', array_keys((array) $message->getTo())); - - $this->logger->info("Pretending to mail message to: {$emails}"); - } - /** * Call the provided message builder. * @@ -459,34 +434,13 @@ protected function createMessage() * * @param string $view * @param array $data - * @return \Illuminate\View\View + * @return string */ protected function getView($view, $data) { return $this->views->make($view, $data)->render(); } - /** - * Tell the mailer to not really send messages. - * - * @param bool $value - * @return void - */ - public function pretend($value = true) - { - $this->pretending = $value; - } - - /** - * Check if the mailer is pretending to send messages. - * - * @return bool - */ - public function isPretending() - { - return $this->pretending; - } - /** * Get the view factory instance. * @@ -528,19 +482,6 @@ public function setSwiftMailer($swift) $this->swift = $swift; } - /** - * Set the log writer instance. - * - * @param \Psr\Log\LoggerInterface $logger - * @return $this - */ - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - - return $this; - } - /** * Set the queue manager instance. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/Message.php b/application/vendor/laravel/framework/src/Illuminate/Mail/Message.php old mode 100644 new mode 100755 index 5dd1fa2..5496a0a --- a/application/vendor/laravel/framework/src/Illuminate/Mail/Message.php +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/Message.php @@ -28,7 +28,7 @@ public function __construct($swift) /** * Add a "from" address to the message. * - * @param string $address + * @param string|array $address * @param string|null $name * @return $this */ @@ -42,7 +42,7 @@ public function from($address, $name = null) /** * Set the "sender" of the message. * - * @param string $address + * @param string|array $address * @param string|null $name * @return $this */ @@ -77,7 +77,9 @@ public function returnPath($address) public function to($address, $name = null, $override = false) { if ($override) { - return $this->swift->setTo($address, $name); + $this->swift->setTo($address, $name); + + return $this; } return $this->addAddresses($address, $name, 'To'); @@ -110,7 +112,7 @@ public function bcc($address, $name = null) /** * Add a reply to address to the message. * - * @param string $address + * @param string|array $address * @param string|null $name * @return $this */ diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/Transport/SparkPostTransport.php b/application/vendor/laravel/framework/src/Illuminate/Mail/Transport/SparkPostTransport.php new file mode 100644 index 0000000..56cf094 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/Transport/SparkPostTransport.php @@ -0,0 +1,127 @@ +key = $key; + $this->client = $client; + $this->options = $options; + } + + /** + * {@inheritdoc} + */ + public function send(Swift_Mime_Message $message, &$failedRecipients = null) + { + $this->beforeSendPerformed($message); + + $recipients = $this->getRecipients($message); + + $message->setBcc([]); + + $options = [ + 'headers' => [ + 'Authorization' => $this->key, + ], + 'json' => [ + 'recipients' => $recipients, + 'content' => [ + 'email_rfc822' => $message->toString(), + ], + ], + ]; + + if ($this->options) { + $options['json']['options'] = $this->options; + } + + return $this->client->post('https://api.sparkpost.com/api/v1/transmissions', $options); + } + + /** + * Get all the addresses this message should be sent to. + * + * Note that SparkPost still respects CC, BCC headers in raw message itself. + * + * @param \Swift_Mime_Message $message + * @return array + */ + protected function getRecipients(Swift_Mime_Message $message) + { + $to = []; + + if ($message->getTo()) { + $to = array_merge($to, array_keys($message->getTo())); + } + + if ($message->getCc()) { + $to = array_merge($to, array_keys($message->getCc())); + } + + if ($message->getBcc()) { + $to = array_merge($to, array_keys($message->getBcc())); + } + + $recipients = array_map(function ($address) { + return compact('address'); + }, $to); + + return $recipients; + } + + /** + * Get the API key being used by the transport. + * + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Set the API key being used by the transport. + * + * @param string $key + * @return string + */ + public function setKey($key) + { + return $this->key = $key; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/TransportManager.php b/application/vendor/laravel/framework/src/Illuminate/Mail/TransportManager.php index d638dcf..0bf100d 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Mail/TransportManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/TransportManager.php @@ -6,12 +6,13 @@ use Illuminate\Support\Arr; use Illuminate\Support\Manager; use GuzzleHttp\Client as HttpClient; -use Swift_MailTransport as MailTransport; use Swift_SmtpTransport as SmtpTransport; +use Swift_MailTransport as MailTransport; use Illuminate\Mail\Transport\LogTransport; use Illuminate\Mail\Transport\SesTransport; use Illuminate\Mail\Transport\MailgunTransport; use Illuminate\Mail\Transport\MandrillTransport; +use Illuminate\Mail\Transport\SparkPostTransport; use Swift_SendmailTransport as SendmailTransport; class TransportManager extends Manager @@ -103,9 +104,10 @@ protected function createMailgunDriver() { $config = $this->app['config']->get('services.mailgun', []); - $client = new HttpClient(Arr::get($config, 'guzzle', [])); - - return new MailgunTransport($client, $config['secret'], $config['domain']); + return new MailgunTransport( + $this->getHttpClient($config), + $config['secret'], $config['domain'] + ); } /** @@ -117,9 +119,25 @@ protected function createMandrillDriver() { $config = $this->app['config']->get('services.mandrill', []); - $client = new HttpClient(Arr::get($config, 'guzzle', [])); + return new MandrillTransport( + $this->getHttpClient($config), $config['secret'] + ); + } - return new MandrillTransport($client, $config['secret']); + /** + * Create an instance of the SparkPost Swift Transport driver. + * + * @return \Illuminate\Mail\Transport\SparkPostTransport + */ + protected function createSparkPostDriver() + { + $config = $this->app['config']->get('services.sparkpost', []); + + return new SparkPostTransport( + $this->getHttpClient($config), + $config['secret'], + Arr::get($config, 'options', []) + ); } /** @@ -133,7 +151,20 @@ protected function createLogDriver() } /** - * Get the default cache driver name. + * Get a fresh Guzzle HTTP client instance. + * + * @param array $config + * @return HttpClient + */ + protected function getHttpClient($config) + { + $guzzleConfig = Arr::get($config, 'guzzle', []); + + return new HttpClient(Arr::add($guzzleConfig, 'connect_timeout', 60)); + } + + /** + * Get the default mail driver name. * * @return string */ @@ -143,7 +174,7 @@ public function getDefaultDriver() } /** - * Set the default cache driver name. + * Set the default mail driver name. * * @param string $name * @return void diff --git a/application/vendor/laravel/framework/src/Illuminate/Mail/composer.json b/application/vendor/laravel/framework/src/Illuminate/Mail/composer.json old mode 100644 new mode 100755 index e59faa3..5121bc0 --- a/application/vendor/laravel/framework/src/Illuminate/Mail/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Mail/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/container": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", "psr/log": "~1.0", "swiftmailer/swiftmailer": "~5.1" }, @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php index 40a68ee..6a4c704 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/AbstractPaginator.php @@ -4,8 +4,11 @@ use Closure; use ArrayIterator; +use Illuminate\Support\Str; +use Illuminate\Support\Collection; +use Illuminate\Contracts\Support\Htmlable; -abstract class AbstractPaginator +abstract class AbstractPaginator implements Htmlable { /** * All of the items being paginated. @@ -127,7 +130,8 @@ public function url($page) $parameters = array_merge($this->query, $parameters); } - return $this->path.'?' + return $this->path + .(Str::contains($this->path, '?') ? '&' : '?') .http_build_query($parameters, '', '&') .$this->buildFragment(); } @@ -235,6 +239,10 @@ public function items() */ public function firstItem() { + if (count($this->items) === 0) { + return; + } + return ($this->currentPage - 1) * $this->perPage + 1; } @@ -245,6 +253,10 @@ public function firstItem() */ public function lastItem() { + if (count($this->items) === 0) { + return; + } + return $this->firstItem() + $this->count() - 1; } @@ -418,6 +430,19 @@ public function getCollection() return $this->items; } + /** + * Set the paginator's underlying collection. + * + * @param \Illuminate\Support\Collection $collection + * @return $this + */ + public function setCollection(Collection $collection) + { + $this->items = $collection; + + return $this; + } + /** * Determine if the given item exists. * @@ -463,6 +488,16 @@ public function offsetUnset($key) $this->items->forget($key); } + /** + * Render the contents of the paginator to HTML. + * + * @return string + */ + public function toHtml() + { + return (string) $this->render(); + } + /** * Make dynamic calls into the collection. * @@ -482,6 +517,6 @@ public function __call($method, $parameters) */ public function __toString() { - return $this->render(); + return (string) $this->render(); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapFourNextPreviousButtonRendererTrait.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapFourNextPreviousButtonRendererTrait.php new file mode 100644 index 0000000..d758dc9 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapFourNextPreviousButtonRendererTrait.php @@ -0,0 +1,48 @@ +paginator->currentPage() <= 1) { + return $this->getDisabledTextWrapper($text); + } + + $url = $this->paginator->url( + $this->paginator->currentPage() - 1 + ); + + return $this->getPageLinkWrapper($url, $text, 'prev'); + } + + /** + * Get the next page pagination element. + * + * @param string $text + * @return string + */ + public function getNextButton($text = '»') + { + // If the current page is greater than or equal to the last page, it means we + // can't go any further into the pages, as we're already on this last page + // that is available, so we will make it the "next" link style disabled. + if (! $this->paginator->hasMorePages()) { + return $this->getDisabledTextWrapper($text); + } + + $url = $this->paginator->url($this->paginator->currentPage() + 1); + + return $this->getPageLinkWrapper($url, $text, 'next'); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapFourPresenter.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapFourPresenter.php new file mode 100644 index 0000000..6a49d4a --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapFourPresenter.php @@ -0,0 +1,135 @@ +paginator = $paginator; + $this->window = is_null($window) ? UrlWindow::make($paginator) : $window->get(); + } + + /** + * Determine if the underlying paginator being presented has pages to show. + * + * @return bool + */ + public function hasPages() + { + return $this->paginator->hasPages(); + } + + /** + * Convert the URL window into Bootstrap HTML. + * + * @return \Illuminate\Support\HtmlString + */ + public function render() + { + if ($this->hasPages()) { + return new HtmlString(sprintf( + '
    %s %s %s
', + $this->getPreviousButton(), + $this->getLinks(), + $this->getNextButton() + )); + } + + return ''; + } + + /** + * Get HTML wrapper for an available page link. + * + * @param string $url + * @param int $page + * @param string|null $rel + * @return string + */ + protected function getAvailablePageWrapper($url, $page, $rel = null) + { + $rel = is_null($rel) ? '' : ' rel="'.$rel.'"'; + + return '
  • '.$page.'
  • '; + } + + /** + * Get HTML wrapper for disabled text. + * + * @param string $text + * @return string + */ + protected function getDisabledTextWrapper($text) + { + return '
  • '.$text.'
  • '; + } + + /** + * Get HTML wrapper for active text. + * + * @param string $text + * @return string + */ + protected function getActivePageWrapper($text) + { + return '
  • '.$text.'
  • '; + } + + /** + * Get a pagination "dot" element. + * + * @return string + */ + protected function getDots() + { + return $this->getDisabledTextWrapper('...'); + } + + /** + * Get the current page from the paginator. + * + * @return int + */ + protected function currentPage() + { + return $this->paginator->currentPage(); + } + + /** + * Get the last page from the paginator. + * + * @return int + */ + protected function lastPage() + { + return $this->paginator->lastPage(); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapThreePresenter.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapThreePresenter.php index 21e647d..c08b0fd 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapThreePresenter.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/BootstrapThreePresenter.php @@ -2,6 +2,7 @@ namespace Illuminate\Pagination; +use Illuminate\Support\HtmlString; use Illuminate\Contracts\Pagination\Paginator as PaginatorContract; use Illuminate\Contracts\Pagination\Presenter as PresenterContract; @@ -49,17 +50,17 @@ public function hasPages() /** * Convert the URL window into Bootstrap HTML. * - * @return string + * @return \Illuminate\Support\HtmlString */ public function render() { if ($this->hasPages()) { - return sprintf( + return new HtmlString(sprintf( '
      %s %s %s
    ', $this->getPreviousButton(), $this->getLinks(), $this->getNextButton() - ); + )); } return ''; diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php index 8c562e1..668f809 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php @@ -4,6 +4,7 @@ use Countable; use ArrayAccess; +use JsonSerializable; use IteratorAggregate; use Illuminate\Support\Collection; use Illuminate\Contracts\Support\Jsonable; @@ -11,7 +12,7 @@ use Illuminate\Contracts\Pagination\Presenter; use Illuminate\Contracts\Pagination\LengthAwarePaginator as LengthAwarePaginatorContract; -class LengthAwarePaginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, LengthAwarePaginatorContract +class LengthAwarePaginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, JsonSerializable, Jsonable, LengthAwarePaginatorContract { /** * The total number of items before slicing. @@ -62,13 +63,6 @@ protected function setCurrentPage($currentPage, $lastPage) { $currentPage = $currentPage ?: static::resolveCurrentPage(); - // The page number will get validated and adjusted if it either less than one - // or greater than the last page available based on the count of the given - // items array. If it's greater than the last, we'll give back the last. - if (is_numeric($currentPage) && $currentPage > $lastPage) { - return $lastPage > 0 ? $lastPage : 1; - } - return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1; } @@ -114,6 +108,17 @@ public function lastPage() return $this->lastPage; } + /** + * Render the paginator using the given presenter. + * + * @param \Illuminate\Contracts\Pagination\Presenter|null $presenter + * @return string + */ + public function links(Presenter $presenter = null) + { + return $this->render($presenter); + } + /** * Render the paginator using the given presenter. * @@ -151,6 +156,16 @@ public function toArray() ]; } + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize() + { + return $this->toArray(); + } + /** * Convert the object to its JSON representation. * @@ -159,6 +174,6 @@ public function toArray() */ public function toJson($options = 0) { - return json_encode($this->toArray(), $options); + return json_encode($this->jsonSerialize(), $options); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/PaginationServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php index 6229f06..6bb2e4e 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/Paginator.php @@ -4,6 +4,7 @@ use Countable; use ArrayAccess; +use JsonSerializable; use IteratorAggregate; use Illuminate\Support\Collection; use Illuminate\Contracts\Support\Jsonable; @@ -11,7 +12,7 @@ use Illuminate\Contracts\Pagination\Presenter; use Illuminate\Contracts\Pagination\Paginator as PaginatorContract; -class Paginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, PaginatorContract +class Paginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, JsonSerializable, Jsonable, PaginatorContract { /** * Determine if there are more items in the data source. @@ -75,7 +76,7 @@ protected function checkForMorePages() */ public function nextPageUrl() { - if ($this->hasMore) { + if ($this->hasMorePages()) { return $this->url($this->currentPage() + 1); } } @@ -90,6 +91,17 @@ public function hasMorePages() return $this->hasMore; } + /** + * Render the paginator using the given presenter. + * + * @param \Illuminate\Contracts\Pagination\Presenter|null $presenter + * @return string + */ + public function links(Presenter $presenter = null) + { + return $this->render($presenter); + } + /** * Render the paginator using the given presenter. * @@ -122,6 +134,16 @@ public function toArray() ]; } + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize() + { + return $this->toArray(); + } + /** * Convert the object to its JSON representation. * @@ -130,6 +152,6 @@ public function toArray() */ public function toJson($options = 0) { - return json_encode($this->toArray(), $options); + return json_encode($this->jsonSerialize(), $options); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapFourPresenter.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapFourPresenter.php new file mode 100644 index 0000000..3f88a6d --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapFourPresenter.php @@ -0,0 +1,48 @@ +paginator = $paginator; + } + + /** + * Determine if the underlying paginator being presented has pages to show. + * + * @return bool + */ + public function hasPages() + { + return $this->paginator->hasPages() && count($this->paginator->items()) > 0; + } + + /** + * Convert the URL window into Bootstrap HTML. + * + * @return \Illuminate\Support\HtmlString + */ + public function render() + { + if ($this->hasPages()) { + return new HtmlString(sprintf( + '
      %s %s
    ', + $this->getPreviousButton(), + $this->getNextButton() + )); + } + + return ''; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapThreePresenter.php b/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapThreePresenter.php index bbb2790..758972f 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapThreePresenter.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/SimpleBootstrapThreePresenter.php @@ -2,6 +2,7 @@ namespace Illuminate\Pagination; +use Illuminate\Support\HtmlString; use Illuminate\Contracts\Pagination\Paginator as PaginatorContract; class SimpleBootstrapThreePresenter extends BootstrapThreePresenter @@ -30,16 +31,16 @@ public function hasPages() /** * Convert the URL window into Bootstrap HTML. * - * @return string + * @return \Illuminate\Support\HtmlString */ public function render() { if ($this->hasPages()) { - return sprintf( + return new HtmlString(sprintf( '
      %s %s
    ', $this->getPreviousButton(), $this->getNextButton() - ); + )); } return ''; diff --git a/application/vendor/laravel/framework/src/Illuminate/Pagination/composer.json b/application/vendor/laravel/framework/src/Illuminate/Pagination/composer.json old mode 100644 new mode 100755 index 871c66e..18ab6cf --- a/application/vendor/laravel/framework/src/Illuminate/Pagination/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Pagination/composer.json @@ -10,13 +10,13 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php b/application/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php index ed48df4..d2084cb 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pipeline/Hub.php @@ -23,7 +23,7 @@ class Hub implements HubContract protected $pipelines = []; /** - * Create a new Depot instance. + * Create a new Hub instance. * * @param \Illuminate\Contracts\Container\Container $container * @return void diff --git a/application/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php b/application/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php index 12aa6d7..030c5f5 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php +++ b/application/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php @@ -112,17 +112,28 @@ protected function getSlice() { return function ($stack, $pipe) { return function ($passable) use ($stack, $pipe) { - // If the pipe is an instance of a Closure, we will just call it directly but - // otherwise we'll resolve the pipes out of the container and call it with - // the appropriate method and arguments, returning the results back out. if ($pipe instanceof Closure) { + // If the pipe is an instance of a Closure, we will just call it directly but + // otherwise we'll resolve the pipes out of the container and call it with + // the appropriate method and arguments, returning the results back out. return call_user_func($pipe, $passable, $stack); - } else { + } elseif (! is_object($pipe)) { list($name, $parameters) = $this->parsePipeString($pipe); - return call_user_func_array([$this->container->make($name), $this->method], - array_merge([$passable, $stack], $parameters)); + // If the pipe is a string we will parse the string and resolve the class out + // of the dependency injection container. We can then build a callable and + // execute the pipe function giving in the parameters that are required. + $pipe = $this->container->make($name); + + $parameters = array_merge([$passable, $stack], $parameters); + } else { + // If the pipe is already an object we'll just make a callable and pass it to + // the pipe as-is. There is no need to do any extra parsing and formatting + // since the object we're given was already a fully instantiated object. + $parameters = [$passable, $stack]; } + + return call_user_func_array([$pipe, $this->method], $parameters); }; }; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json b/application/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json index 85b0734..f2b21cf 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Pipeline/composer.json @@ -10,13 +10,13 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/BeanstalkdQueue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/BeanstalkdQueue.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php b/application/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php index dc16c88..baca626 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php @@ -38,9 +38,7 @@ public function call(Job $job, array $data) $job, unserialize($data['command']) ); - $this->dispatcher->dispatchNow($command, function ($handler) use ($job) { - $this->setJobInstanceIfNecessary($job, $handler); - }); + $this->dispatcher->dispatchNow($command); if (! $job->isDeletedOrReleased()) { $job->delete(); @@ -71,10 +69,10 @@ protected function setJobInstanceIfNecessary(Job $job, $instance) */ public function failed(array $data) { - $handler = $this->dispatcher->resolveHandler($command = unserialize($data['command'])); + $command = unserialize($data['command']); - if (method_exists($handler, 'failed')) { - call_user_func([$handler, 'failed'], $command); + if (method_exists($command, 'failed')) { + $command->failed(); } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/ConnectorInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/IronConnector.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/IronConnector.php deleted file mode 100644 index d103c19..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/IronConnector.php +++ /dev/null @@ -1,61 +0,0 @@ -crypt = $crypt; - $this->request = $request; - } - - /** - * Establish a queue connection. - * - * @param array $config - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connect(array $config) - { - $ironConfig = ['token' => $config['token'], 'project_id' => $config['project']]; - - if (isset($config['host'])) { - $ironConfig['host'] = $config['host']; - } - - $iron = new IronMQ($ironConfig); - - if (isset($config['ssl_verifypeer'])) { - $iron->ssl_verifypeer = $config['ssl_verifypeer']; - } - - return new IronQueue($iron, $this->request, $config['queue'], $config['encrypt']); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SyncConnector.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SyncConnector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php index 44197ea..9826498 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/FailedTableCommand.php @@ -4,7 +4,7 @@ use Illuminate\Support\Str; use Illuminate\Console\Command; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; class FailedTableCommand extends Command @@ -31,7 +31,7 @@ class FailedTableCommand extends Command protected $files; /** - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -39,7 +39,7 @@ class FailedTableCommand extends Command * Create a new failed queue jobs table command instance. * * @param \Illuminate\Filesystem\Filesystem $files - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(Filesystem $files, Composer $composer) diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/ListenCommand.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/SubscribeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/SubscribeCommand.php deleted file mode 100644 index a19be46..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/SubscribeCommand.php +++ /dev/null @@ -1,162 +0,0 @@ -laravel['queue']->connection(); - - if (! $iron instanceof IronQueue) { - throw new RuntimeException('Iron.io based queue must be default.'); - } - - $iron->getIron()->updateQueue($this->argument('queue'), $this->getQueueOptions()); - - $this->line('Queue subscriber added: '.$this->argument('url').''); - } - - /** - * Get the queue options. - * - * @return array - */ - protected function getQueueOptions() - { - return [ - 'push_type' => $this->getPushType(), 'subscribers' => $this->getSubscriberList(), - ]; - } - - /** - * Get the push type for the queue. - * - * @return string - */ - protected function getPushType() - { - if ($this->option('type')) { - return $this->option('type'); - } - - try { - return $this->getQueue()->push_type; - } catch (Exception $e) { - return 'multicast'; - } - } - - /** - * Get the current subscribers for the queue. - * - * @return array - */ - protected function getSubscriberList() - { - $subscribers = $this->getCurrentSubscribers(); - - $url = $this->argument('url'); - - if (! Str::startsWith($url, ['http://', 'https://'])) { - $url = $this->laravel['url']->to($url); - } - - $subscribers[] = ['url' => $url]; - - return $subscribers; - } - - /** - * Get the current subscriber list. - * - * @return array - */ - protected function getCurrentSubscribers() - { - try { - return $this->getQueue()->subscribers; - } catch (Exception $e) { - return []; - } - } - - /** - * Get the queue information from Iron.io. - * - * @return object - */ - protected function getQueue() - { - if (isset($this->meta)) { - return $this->meta; - } - - return $this->meta = $this->laravel['queue']->getIron()->getQueue($this->argument('queue')); - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['queue', InputArgument::REQUIRED, 'The name of Iron.io queue.'], - - ['url', InputArgument::REQUIRED, 'The URL to be subscribed.'], - ]; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['type', null, InputOption::VALUE_OPTIONAL, 'The push type for the queue.'], - ]; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php index f41d15c..1fc2ebb 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/TableCommand.php @@ -4,7 +4,7 @@ use Illuminate\Support\Str; use Illuminate\Console\Command; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; class TableCommand extends Command @@ -31,7 +31,7 @@ class TableCommand extends Command protected $files; /** - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -39,7 +39,7 @@ class TableCommand extends Command * Create a new queue job table command instance. * * @param \Illuminate\Filesystem\Filesystem $files - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(Filesystem $files, Composer $composer) diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php old mode 100644 new mode 100755 index 586fa6e..a4555b1 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php @@ -2,9 +2,12 @@ namespace Illuminate\Queue\Console; +use Carbon\Carbon; use Illuminate\Queue\Worker; use Illuminate\Console\Command; use Illuminate\Contracts\Queue\Job; +use Illuminate\Queue\Events\JobFailed; +use Illuminate\Queue\Events\JobProcessed; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; @@ -55,6 +58,11 @@ public function fire() return $this->worker->sleep($this->option('sleep')); } + // We'll listen to the processed and failed events so we can write information + // to the console as jobs are processed, which will let the developer watch + // which jobs are coming through a queue and be informed on its progress. + $this->listenForEvents(); + $queue = $this->option('queue'); $delay = $this->option('delay'); @@ -66,16 +74,25 @@ public function fire() $connection = $this->argument('connection'); - $response = $this->runWorker( + $this->runWorker( $connection, $queue, $delay, $memory, $this->option('daemon') ); + } - // If a job was fired by the worker, we'll write the output out to the console - // so that the developer can watch live while the queue runs in the console - // window, which will also of get logged if stdout is logged out to disk. - if (! is_null($response['job'])) { - $this->writeOutput($response['job'], $response['failed']); - } + /** + * Listen for the queue events in order to update the console output. + * + * @return void + */ + protected function listenForEvents() + { + $this->laravel['events']->listen(JobProcessed::class, function ($event) { + $this->writeOutput($event->job, false); + }); + + $this->laravel['events']->listen(JobFailed::class, function ($event) { + $this->writeOutput($event->job, true); + }); } /** @@ -119,9 +136,9 @@ protected function runWorker($connection, $queue, $delay, $memory, $daemon = fal protected function writeOutput(Job $job, $failed) { if ($failed) { - $this->output->writeln('Failed: '.$job->getName()); + $this->output->writeln('['.Carbon::now()->format('Y-m-d H:i:s').'] Failed: '.$job->resolveName()); } else { - $this->output->writeln('Processed: '.$job->getName()); + $this->output->writeln('['.Carbon::now()->format('Y-m-d H:i:s').'] Processed: '.$job->resolveName()); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/ConsoleServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Queue/ConsoleServiceProvider.php index 395e686..a376813 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/ConsoleServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/ConsoleServiceProvider.php @@ -4,9 +4,7 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Queue\Console\RetryCommand; -use Illuminate\Queue\Console\TableCommand; use Illuminate\Queue\Console\ListFailedCommand; -use Illuminate\Queue\Console\FailedTableCommand; use Illuminate\Queue\Console\FlushFailedCommand; use Illuminate\Queue\Console\ForgetFailedCommand; @@ -26,10 +24,6 @@ class ConsoleServiceProvider extends ServiceProvider */ public function register() { - $this->app->singleton('command.queue.table', function ($app) { - return new TableCommand($app['files'], $app['composer']); - }); - $this->app->singleton('command.queue.failed', function () { return new ListFailedCommand; }); @@ -46,13 +40,9 @@ public function register() return new FlushFailedCommand; }); - $this->app->singleton('command.queue.failed-table', function ($app) { - return new FailedTableCommand($app['files'], $app['composer']); - }); - $this->commands( - 'command.queue.table', 'command.queue.failed', 'command.queue.retry', - 'command.queue.forget', 'command.queue.flush', 'command.queue.failed-table' + 'command.queue.failed', 'command.queue.retry', + 'command.queue.forget', 'command.queue.flush' ); } @@ -64,8 +54,8 @@ public function register() public function provides() { return [ - 'command.queue.table', 'command.queue.failed', 'command.queue.retry', - 'command.queue.forget', 'command.queue.flush', 'command.queue.failed-table', + 'command.queue.failed', 'command.queue.retry', + 'command.queue.forget', 'command.queue.flush', ]; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php index 7aa6db8..8ef03e5 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php @@ -6,7 +6,6 @@ use Carbon\Carbon; use Illuminate\Database\Connection; use Illuminate\Queue\Jobs\DatabaseJob; -use Illuminate\Database\Query\Expression; use Illuminate\Contracts\Queue\Queue as QueueContract; class DatabaseQueue extends Queue implements QueueContract @@ -160,12 +159,10 @@ public function pop($queue = null) { $queue = $this->getQueue($queue); - if (! is_null($this->expire)) { - $this->releaseJobsThatHaveBeenReservedTooLong($queue); - } + $this->database->beginTransaction(); if ($job = $this->getNextAvailableJob($queue)) { - $this->markJobAsReserved($job->id); + $job = $this->markJobAsReserved($job); $this->database->commit(); @@ -177,27 +174,6 @@ public function pop($queue = null) $this->database->commit(); } - /** - * Release the jobs that have been reserved for too long. - * - * @param string $queue - * @return void - */ - protected function releaseJobsThatHaveBeenReservedTooLong($queue) - { - $expired = Carbon::now()->subSeconds($this->expire)->getTimestamp(); - - $this->database->table($this->table) - ->where('queue', $this->getQueue($queue)) - ->where('reserved', 1) - ->where('reserved_at', '<=', $expired) - ->update([ - 'reserved' => 0, - 'reserved_at' => null, - 'attempts' => new Expression('attempts + 1'), - ]); - } - /** * Get the next available job for the queue. * @@ -206,13 +182,13 @@ protected function releaseJobsThatHaveBeenReservedTooLong($queue) */ protected function getNextAvailableJob($queue) { - $this->database->beginTransaction(); - $job = $this->database->table($this->table) ->lockForUpdate() ->where('queue', $this->getQueue($queue)) - ->where('reserved', 0) - ->where('available_at', '<=', $this->getTime()) + ->where(function ($query) { + $this->isAvailable($query); + $this->isReservedButExpired($query); + }) ->orderBy('id', 'asc') ->first(); @@ -220,16 +196,54 @@ protected function getNextAvailableJob($queue) } /** - * Mark the given job ID as reserved. + * Modify the query to check for available jobs. * - * @param string $id + * @param \Illuminate\Database\Query\Builder $query * @return void */ - protected function markJobAsReserved($id) + protected function isAvailable($query) { - $this->database->table($this->table)->where('id', $id)->update([ - 'reserved' => 1, 'reserved_at' => $this->getTime(), + $query->where(function ($query) { + $query->where('reserved', 0); + $query->where('available_at', '<=', $this->getTime()); + }); + } + + /** + * Modify the query to check for jobs that are reserved but have expired. + * + * @param \Illuminate\Database\Query\Builder $query + * @return void + */ + protected function isReservedButExpired($query) + { + $expiration = Carbon::now()->subSeconds($this->expire)->getTimestamp(); + + $query->orWhere(function ($query) use ($expiration) { + $query->where('reserved', 1); + $query->where('reserved_at', '<=', $expiration); + }); + } + + /** + * Mark the given job ID as reserved. + * + * @param \stdClass $job + * @return \stdClass + */ + protected function markJobAsReserved($job) + { + $job->reserved = 1; + $job->attempts = $job->attempts + 1; + $job->reserved_at = $this->getTime(); + + $this->database->table($this->table)->where('id', $job->id)->update([ + 'reserved' => $job->reserved, + 'reserved_at' => $job->reserved_at, + 'attempts' => $job->attempts, ]); + + return $job; } /** @@ -241,7 +255,13 @@ protected function markJobAsReserved($id) */ public function deleteReserved($queue, $id) { - $this->database->table($this->table)->where('id', $id)->delete(); + $this->database->beginTransaction(); + + if ($this->database->table($this->table)->lockForUpdate()->find($id)) { + $this->database->table($this->table)->where('id', $id)->delete(); + } + + $this->database->commit(); } /** @@ -270,12 +290,12 @@ protected function buildDatabaseRecord($queue, $payload, $availableAt, $attempts { return [ 'queue' => $queue, - 'payload' => $payload, 'attempts' => $attempts, 'reserved' => 0, 'reserved_at' => null, 'available_at' => $availableAt, 'created_at' => $this->getTime(), + 'payload' => $payload, ]; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php new file mode 100644 index 0000000..fff5db3 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobExceptionOccurred.php @@ -0,0 +1,51 @@ +job = $job; + $this->data = $data; + $this->exception = $exception; + $this->connectionName = $connectionName; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php new file mode 100644 index 0000000..a46fbb6 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobFailed.php @@ -0,0 +1,51 @@ +job = $job; + $this->data = $data; + $this->failedId = $failedId; + $this->connectionName = $connectionName; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php new file mode 100644 index 0000000..40af3c5 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessed.php @@ -0,0 +1,42 @@ +job = $job; + $this->data = $data; + $this->connectionName = $connectionName; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php new file mode 100644 index 0000000..b37cd52 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/JobProcessing.php @@ -0,0 +1,42 @@ +job = $job; + $this->data = $data; + $this->connectionName = $connectionName; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php new file mode 100644 index 0000000..6c51209 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Events/WorkerStopping.php @@ -0,0 +1,8 @@ +getTable()->insert(compact('connection', 'queue', 'payload', 'failed_at')); + return $this->getTable()->insertGetId(compact('connection', 'queue', 'payload', 'failed_at')); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php index 1b207c0..75c90ee 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/FailedJobProviderInterface.php @@ -10,7 +10,7 @@ interface FailedJobProviderInterface * @param string $connection * @param string $queue * @param string $payload - * @return void + * @return int|null */ public function log($connection, $queue, $payload); diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/NullFailedJobProvider.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/NullFailedJobProvider.php index 997aa37..5f2b1ec 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/NullFailedJobProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Failed/NullFailedJobProvider.php @@ -10,7 +10,7 @@ class NullFailedJobProvider implements FailedJobProviderInterface * @param string $connection * @param string $queue * @param string $payload - * @return void + * @return int|null */ public function log($connection, $queue, $payload) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/IlluminateQueueClosure.php b/application/vendor/laravel/framework/src/Illuminate/Queue/IlluminateQueueClosure.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php index bf1e021..13b51df 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/InteractsWithQueue.php @@ -13,6 +13,16 @@ trait InteractsWithQueue */ protected $job; + /** + * Get the number of times the job has been attempted. + * + * @return int + */ + public function attempts() + { + return $this->job ? $this->job->attempts() : 1; + } + /** * Delete the job from the queue. * @@ -26,26 +36,28 @@ public function delete() } /** - * Release the job back into the queue. + * Fail the job from the queue. * - * @param int $delay * @return void */ - public function release($delay = 0) + public function failed() { if ($this->job) { - return $this->job->release($delay); + return $this->job->failed(); } } /** - * Get the number of times the job has been attempted. + * Release the job back into the queue. * - * @return int + * @param int $delay + * @return void */ - public function attempts() + public function release($delay = 0) { - return $this->job ? $this->job->attempts() : 1; + if ($this->job) { + return $this->job->release($delay); + } } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/IronQueue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/IronQueue.php deleted file mode 100644 index 6831889..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/IronQueue.php +++ /dev/null @@ -1,263 +0,0 @@ -iron = $iron; - $this->request = $request; - $this->default = $default; - $this->shouldEncrypt = $shouldEncrypt; - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - return $this->pushRaw($this->createPayload($job, $data, $queue), $queue); - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - if ($this->shouldEncrypt) { - $payload = $this->crypt->encrypt($payload); - } - - return $this->iron->postMessage($this->getQueue($queue), $payload, $options)->id; - } - - /** - * Push a raw payload onto the queue after encrypting the payload. - * - * @param string $payload - * @param string $queue - * @param int $delay - * @return mixed - */ - public function recreate($payload, $queue, $delay) - { - $options = ['delay' => $this->getSeconds($delay)]; - - return $this->pushRaw($payload, $queue, $options); - } - - /** - * Push a new job onto the queue after a delay. - * - * @param \DateTime|int $delay - * @param string $job - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - $delay = $this->getSeconds($delay); - - $payload = $this->createPayload($job, $data, $queue); - - return $this->pushRaw($payload, $queue, compact('delay')); - } - - /** - * Pop the next job off of the queue. - * - * @param string $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - $queue = $this->getQueue($queue); - - $job = $this->iron->getMessage($queue); - - // If we were able to pop a message off of the queue, we will need to decrypt - // the message body, as all Iron.io messages are encrypted, since the push - // queues will be a security hazard to unsuspecting developers using it. - if (! is_null($job)) { - $job->body = $this->parseJobBody($job->body); - - return new IronJob($this->container, $this, $job); - } - } - - /** - * Delete a message from the Iron queue. - * - * @param string $queue - * @param string $id - * @return void - */ - public function deleteMessage($queue, $id) - { - $this->iron->deleteMessage($queue, $id); - } - - /** - * Marshal a push queue request and fire the job. - * - * @return \Illuminate\Http\Response - * - * @deprecated since version 5.1. - */ - public function marshal() - { - $this->createPushedIronJob($this->marshalPushedJob())->fire(); - - return new Response('OK'); - } - - /** - * Marshal out the pushed job and payload. - * - * @return object - */ - protected function marshalPushedJob() - { - $r = $this->request; - - $body = $this->parseJobBody($r->getContent()); - - return (object) [ - 'id' => $r->header('iron-message-id'), 'body' => $body, 'pushed' => true, - ]; - } - - /** - * Create a new IronJob for a pushed job. - * - * @param object $job - * @return \Illuminate\Queue\Jobs\IronJob - */ - protected function createPushedIronJob($job) - { - return new IronJob($this->container, $this, $job, true); - } - - /** - * Create a payload string from the given job and data. - * - * @param string $job - * @param mixed $data - * @param string $queue - * @return string - */ - protected function createPayload($job, $data = '', $queue = null) - { - $payload = $this->setMeta(parent::createPayload($job, $data), 'attempts', 1); - - return $this->setMeta($payload, 'queue', $this->getQueue($queue)); - } - - /** - * Parse the job body for firing. - * - * @param string $body - * @return string - */ - protected function parseJobBody($body) - { - return $this->shouldEncrypt ? $this->crypt->decrypt($body) : $body; - } - - /** - * Get the queue or return the default. - * - * @param string|null $queue - * @return string - */ - public function getQueue($queue) - { - return $queue ?: $this->default; - } - - /** - * Get the underlying IronMQ instance. - * - * @return \IronMQ\IronMQ - */ - public function getIron() - { - return $this->iron; - } - - /** - * Get the request instance. - * - * @return \Illuminate\Http\Request - */ - public function getRequest() - { - return $this->request; - } - - /** - * Set the request instance. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - public function setRequest(Request $request) - { - $this->request = $request; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/BeanstalkdJob.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/BeanstalkdJob.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php index 4bcc8eb..bfeed8a 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php @@ -2,8 +2,8 @@ namespace Illuminate\Queue\Jobs; -use Illuminate\Container\Container; use Illuminate\Queue\DatabaseQueue; +use Illuminate\Container\Container; use Illuminate\Contracts\Queue\Job as JobContract; class DatabaseJob extends Job implements JobContract @@ -37,7 +37,6 @@ public function __construct(Container $container, DatabaseQueue $database, $job, $this->queue = $queue; $this->database = $database; $this->container = $container; - $this->job->attempts = $this->job->attempts + 1; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php deleted file mode 100644 index 6793bcd..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php +++ /dev/null @@ -1,180 +0,0 @@ -job = $job; - $this->iron = $iron; - $this->pushed = $pushed; - $this->container = $container; - } - - /** - * Fire the job. - * - * @return void - */ - public function fire() - { - $this->resolveAndFire(json_decode($this->getRawBody(), true)); - } - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody() - { - return $this->job->body; - } - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete() - { - parent::delete(); - - if (isset($this->job->pushed)) { - return; - } - - $this->iron->deleteMessage($this->getQueue(), $this->job->id); - } - - /** - * Release the job back into the queue. - * - * @param int $delay - * @return void - */ - public function release($delay = 0) - { - parent::release($delay); - - if (! $this->pushed) { - $this->delete(); - } - - $this->recreateJob($delay); - } - - /** - * Release a pushed job back onto the queue. - * - * @param int $delay - * @return void - */ - protected function recreateJob($delay) - { - $payload = json_decode($this->job->body, true); - - Arr::set($payload, 'attempts', Arr::get($payload, 'attempts', 1) + 1); - - $this->iron->recreate(json_encode($payload), $this->getQueue(), $delay); - } - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts() - { - return Arr::get(json_decode($this->job->body, true), 'attempts', 1); - } - - /** - * Get the job identifier. - * - * @return string - */ - public function getJobId() - { - return $this->job->id; - } - - /** - * Get the IoC container instance. - * - * @return \Illuminate\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Get the underlying Iron queue instance. - * - * @return \Illuminate\Queue\IronQueue - */ - public function getIron() - { - return $this->iron; - } - - /** - * Get the underlying IronMQ job. - * - * @return array - */ - public function getIronJob() - { - return $this->job; - } - - /** - * Get the name of the queue the job belongs to. - * - * @return string - */ - public function getQueue() - { - return Arr::get(json_decode($this->job->body, true), 'queue'); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php old mode 100644 new mode 100755 index 304bc9d..4237e12 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php @@ -3,6 +3,7 @@ namespace Illuminate\Queue\Jobs; use DateTime; +use Illuminate\Support\Arr; use Illuminate\Support\Str; abstract class Job @@ -258,6 +259,28 @@ public function getName() return json_decode($this->getRawBody(), true)['job']; } + /** + * Get the resolved name of the queued job class. + * + * @return string + */ + public function resolveName() + { + $name = $this->getName(); + + $payload = json_decode($this->getRawBody(), true); + + if ($name === 'Illuminate\Queue\CallQueuedHandler@call') { + return Arr::get($payload, 'data.commandName', $name); + } + + if ($name === 'Illuminate\Events\CallQueuedHandler@call') { + return $payload['data']['class'].'@'.$payload['data']['method']; + } + + return $name; + } + /** * Get the name of the queue the job belongs to. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SqsJob.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php old mode 100644 new mode 100755 index c1f2236..fe7df17 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Jobs/SyncJob.php @@ -26,12 +26,10 @@ class SyncJob extends Job implements JobContract * * @param \Illuminate\Container\Container $container * @param string $payload - * @param string $queue * @return void */ - public function __construct(Container $container, $payload, $queue) + public function __construct(Container $container, $payload) { - $this->queue = $queue; $this->payload = $payload; $this->container = $container; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Listener.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Listener.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Queue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Queue.php old mode 100644 new mode 100755 index 07fbd90..400e889 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Queue.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Queue.php @@ -4,12 +4,12 @@ use Closure; use DateTime; -use RuntimeException; +use Exception; use Illuminate\Support\Arr; use SuperClosure\Serializer; use Illuminate\Container\Container; +use Illuminate\Contracts\Encryption\Encrypter; use Illuminate\Contracts\Queue\QueueableEntity; -use Illuminate\Contracts\Encryption\Encrypter as EncrypterContract; abstract class Queue { @@ -20,6 +20,13 @@ abstract class Queue */ protected $container; + /** + * The encrypter implementation. + * + * @var \Illuminate\Contracts\Encryption\Encrypter + */ + protected $encrypter; + /** * Push a new job onto the queue. * @@ -47,18 +54,6 @@ public function laterOn($queue, $delay, $job, $data = '') return $this->later($delay, $job, $data, $queue); } - /** - * Marshal a push queue request and fire the job. - * - * @throws \RuntimeException - * - * @deprecated since version 5.1. - */ - public function marshal() - { - throw new RuntimeException('Push queues only supported by Iron.'); - } - /** * Push an array of jobs onto the queue. * @@ -86,10 +81,12 @@ protected function createPayload($job, $data = '', $queue = null) { if ($job instanceof Closure) { return json_encode($this->createClosurePayload($job, $data)); - } elseif (is_object($job)) { + } + + if (is_object($job)) { return json_encode([ 'job' => 'Illuminate\Queue\CallQueuedHandler@call', - 'data' => ['command' => serialize(clone $job)], + 'data' => ['commandName' => get_class($job), 'command' => serialize(clone $job)], ]); } @@ -153,11 +150,11 @@ protected function prepareQueueableEntity($value) * * @param \Closure $job * @param mixed $data - * @return string + * @return array */ protected function createClosurePayload($job, $data) { - $closure = $this->crypt->encrypt((new Serializer)->serialize($job)); + $closure = $this->getEncrypter()->encrypt((new Serializer)->serialize($job)); return ['job' => 'IlluminateQueueClosure', 'data' => compact('closure')]; } @@ -214,13 +211,29 @@ public function setContainer(Container $container) } /** - * Set the encrypter instance. + * Get the encrypter implementation. + * + * @return \Illuminate\Contracts\Encryption\Encrypter + * + * @throws \Exception + */ + protected function getEncrypter() + { + if (is_null($this->encrypter)) { + throw new Exception('No encrypter has been set on the Queue.'); + } + + return $this->encrypter; + } + + /** + * Set the encrypter implementation. * - * @param \Illuminate\Contracts\Encryption\Encrypter $crypt + * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter * @return void */ - public function setEncrypter(EncrypterContract $crypt) + public function setEncrypter(Encrypter $encrypter) { - $this->crypt = $crypt; + $this->encrypter = $encrypter; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php b/application/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php old mode 100644 new mode 100755 index cf91bbd..2b271e0 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php @@ -41,6 +41,17 @@ public function __construct($app) $this->app = $app; } + /** + * Register an event listener for the before job event. + * + * @param mixed $callback + * @return void + */ + public function before($callback) + { + $this->app['events']->listen(Events\JobProcessing::class, $callback); + } + /** * Register an event listener for the after job event. * @@ -49,7 +60,18 @@ public function __construct($app) */ public function after($callback) { - $this->app['events']->listen('illuminate.queue.after', $callback); + $this->app['events']->listen(Events\JobProcessed::class, $callback); + } + + /** + * Register an event listener for the exception occurred job event. + * + * @param mixed $callback + * @return void + */ + public function exceptionOccurred($callback) + { + $this->app['events']->listen(Events\JobExceptionOccurred::class, $callback); } /** @@ -71,7 +93,7 @@ public function looping($callback) */ public function failing($callback) { - $this->app['events']->listen('illuminate.queue.failed', $callback); + $this->app['events']->listen(Events\JobFailed::class, $callback); } /** @@ -82,7 +104,7 @@ public function failing($callback) */ public function stopping($callback) { - $this->app['events']->listen('illuminate.queue.stopping', $callback); + $this->app['events']->listen(Events\WorkerStopping::class, $callback); } /** @@ -182,6 +204,10 @@ public function addConnector($driver, Closure $resolver) */ protected function getConfig($name) { + if ($name === null || $name === 'null') { + return ['driver' => 'null']; + } + return $this->app['config']["queue.connections.{$name}"]; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php old mode 100644 new mode 100755 index 5957a89..17258b1 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php @@ -8,13 +8,11 @@ use Illuminate\Queue\Console\ListenCommand; use Illuminate\Queue\Console\RestartCommand; use Illuminate\Queue\Connectors\SqsConnector; -use Illuminate\Queue\Connectors\IronConnector; use Illuminate\Queue\Connectors\NullConnector; use Illuminate\Queue\Connectors\SyncConnector; -use Illuminate\Queue\Console\SubscribeCommand; use Illuminate\Queue\Connectors\RedisConnector; -use Illuminate\Queue\Connectors\DatabaseConnector; use Illuminate\Queue\Failed\NullFailedJobProvider; +use Illuminate\Queue\Connectors\DatabaseConnector; use Illuminate\Queue\Connectors\BeanstalkdConnector; use Illuminate\Queue\Failed\DatabaseFailedJobProvider; @@ -40,8 +38,6 @@ public function register() $this->registerListener(); - $this->registerSubscriber(); - $this->registerFailedJobServices(); $this->registerQueueClosure(); @@ -142,20 +138,6 @@ public function registerRestartCommand() $this->commands('command.queue.restart'); } - /** - * Register the push queue subscribe command. - * - * @return void - */ - protected function registerSubscriber() - { - $this->app->singleton('command.queue.subscribe', function () { - return new SubscribeCommand; - }); - - $this->commands('command.queue.subscribe'); - } - /** * Register the connectors on the queue manager. * @@ -164,7 +146,7 @@ protected function registerSubscriber() */ public function registerConnectors($manager) { - foreach (['Null', 'Sync', 'Database', 'Beanstalkd', 'Redis', 'Sqs', 'Iron'] as $connector) { + foreach (['Null', 'Sync', 'Database', 'Beanstalkd', 'Redis', 'Sqs'] as $connector) { $this->{"register{$connector}Connector"}($manager); } } @@ -249,37 +231,6 @@ protected function registerSqsConnector($manager) }); } - /** - * Register the IronMQ queue connector. - * - * @param \Illuminate\Queue\QueueManager $manager - * @return void - */ - protected function registerIronConnector($manager) - { - $app = $this->app; - - $manager->addConnector('iron', function () use ($app) { - return new IronConnector($app['encrypter'], $app['request']); - }); - - $this->registerIronRequestBinder(); - } - - /** - * Register the request rebinding event for the Iron queue. - * - * @return void - */ - protected function registerIronRequestBinder() - { - $this->app->rebinding('request', function ($app, $request) { - if ($app['queue']->connected('iron')) { - $app['queue']->connection('iron')->setRequest($request); - } - }); - } - /** * Register the failed job services. * @@ -319,8 +270,8 @@ public function provides() { return [ 'queue', 'queue.worker', 'queue.listener', 'queue.failer', - 'command.queue.work', 'command.queue.listen', 'command.queue.restart', - 'command.queue.subscribe', 'queue.connection', + 'command.queue.work', 'command.queue.listen', + 'command.queue.restart', 'queue.connection', ]; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php b/application/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php index 9ad9cf7..0336da8 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/SerializesModels.php @@ -6,6 +6,7 @@ use ReflectionProperty; use Illuminate\Contracts\Queue\QueueableEntity; use Illuminate\Contracts\Database\ModelIdentifier; +use Illuminate\Database\Eloquent\Collection as EloquentCollection; trait SerializesModels { @@ -51,8 +52,11 @@ public function __wakeup() */ protected function getSerializedPropertyValue($value) { - return $value instanceof QueueableEntity - ? new ModelIdentifier(get_class($value), $value->getQueueableId()) : $value; + if ($value instanceof QueueableEntity) { + return new ModelIdentifier(get_class($value), $value->getQueueableId()); + } + + return $value; } /** @@ -63,9 +67,31 @@ protected function getSerializedPropertyValue($value) */ protected function getRestoredPropertyValue($value) { - return $value instanceof ModelIdentifier - ? (new $value->class)->newQuery()->useWritePdo()->findOrFail($value->id) - : $value; + if (! $value instanceof ModelIdentifier) { + return $value; + } + + return is_array($value->id) + ? $this->restoreCollection($value) + : (new $value->class)->newQuery()->useWritePdo()->findOrFail($value->id); + } + + /** + * Restore a queueable collection instance. + * + * @param \Illuminate\Contracts\Database\ModelIdentifier $value + * @return \Illuminate\Database\Eloquent\Collection + */ + protected function restoreCollection($value) + { + if (! $value->class || count($value->id) === 0) { + return new EloquentCollection; + } + + $model = new $value->class; + + return $model->newQuery()->useWritePdo() + ->whereIn($model->getKeyName(), $value->id)->get(); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php b/application/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php old mode 100644 new mode 100755 index 36516db..f234a42 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php @@ -17,21 +17,28 @@ class SyncQueue extends Queue implements QueueContract * @param mixed $data * @param string $queue * @return mixed - * @throws \Throwable + * + * @throws \Exception|\Throwable */ public function push($job, $data = '', $queue = null) { - $queueJob = $this->resolveJob($this->createPayload($job, $data, $queue), $queue); + $queueJob = $this->resolveJob($this->createPayload($job, $data, $queue)); try { + $this->raiseBeforeJobEvent($queueJob); + $queueJob->fire(); $this->raiseAfterJobEvent($queueJob); } catch (Exception $e) { + $this->raiseExceptionOccurredJobEvent($queueJob, $e); + $this->handleFailedJob($queueJob); throw $e; } catch (Throwable $e) { + $this->raiseExceptionOccurredJobEvent($queueJob, $e); + $this->handleFailedJob($queueJob); throw $e; @@ -82,12 +89,26 @@ public function pop($queue = null) * Resolve a Sync job instance. * * @param string $payload - * @param string $queue * @return \Illuminate\Queue\Jobs\SyncJob */ - protected function resolveJob($payload, $queue) + protected function resolveJob($payload) { - return new SyncJob($this->container, $payload, $queue); + return new SyncJob($this->container, $payload); + } + + /** + * Raise the before queue job event. + * + * @param \Illuminate\Contracts\Queue\Job $job + * @return void + */ + protected function raiseBeforeJobEvent(Job $job) + { + $data = json_decode($job->getRawBody(), true); + + if ($this->container->bound('events')) { + $this->container['events']->fire(new Events\JobProcessing('sync', $job, $data)); + } } /** @@ -101,7 +122,23 @@ protected function raiseAfterJobEvent(Job $job) $data = json_decode($job->getRawBody(), true); if ($this->container->bound('events')) { - $this->container['events']->fire('illuminate.queue.after', ['sync', $job, $data]); + $this->container['events']->fire(new Events\JobProcessed('sync', $job, $data)); + } + } + + /** + * Raise the exception occurred queue job event. + * + * @param \Illuminate\Contracts\Queue\Job $job + * @param \Throwable $exception + * @return void + */ + protected function raiseExceptionOccurredJobEvent(Job $job, $exception) + { + $data = json_decode($job->getRawBody(), true); + + if ($this->container->bound('events')) { + $this->container['events']->fire(new Events\JobExceptionOccurred('sync', $job, $data, $exception)); } } @@ -129,7 +166,7 @@ protected function raiseFailedJobEvent(Job $job) $data = json_decode($job->getRawBody(), true); if ($this->container->bound('events')) { - $this->container['events']->fire('illuminate.queue.failed', ['sync', $job, $data]); + $this->container['events']->fire(new Events\JobFailed('sync', $job, $data)); } } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/Worker.php b/application/vendor/laravel/framework/src/Illuminate/Queue/Worker.php old mode 100644 new mode 100755 index 47bfc09..7420452 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/Worker.php +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/Worker.php @@ -127,11 +127,8 @@ protected function runNextJobForDaemon($connectionName, $queue, $delay, $sleep, */ protected function daemonShouldRun() { - if ($this->manager->isDownForMaintenance()) { - return false; - } - - return $this->events->until('illuminate.queue.looping') !== false; + return $this->manager->isDownForMaintenance() + ? false : $this->events->until('illuminate.queue.looping') !== false; } /** @@ -163,10 +160,6 @@ public function pop($connectionName, $queue = null, $delay = 0, $sleep = 3, $max if ($this->exceptions) { $this->exceptions->report($e); } - } catch (Throwable $e) { - if ($this->exceptions) { - $this->exceptions->report(new FatalThrowableError($e)); - } } $this->sleep($sleep); @@ -212,29 +205,65 @@ public function process($connection, Job $job, $maxTries = 0, $delay = 0) } try { - // First we will fire off the job. Once it is done we will see if it will - // be auto-deleted after processing and if so we will go ahead and run - // the delete method on the job. Otherwise we will just keep moving. + $this->raiseBeforeJobEvent($connection, $job); + + // First we will fire off the job. Once it is done we will see if it will be + // automatically deleted after processing and if so we'll fire the delete + // method on the job. Otherwise, we will just keep on running our jobs. $job->fire(); $this->raiseAfterJobEvent($connection, $job); return ['job' => $job, 'failed' => false]; } catch (Exception $e) { - // If we catch an exception, we will attempt to release the job back onto - // the queue so it is not lost. This will let is be retried at a later - // time by another listener (or the same one). We will do that here. - if (! $job->isDeleted()) { - $job->release($delay); - } - - throw $e; + $this->handleJobException($connection, $job, $delay, $e); } catch (Throwable $e) { + $this->handleJobException($connection, $job, $delay, $e); + } + } + + /** + * Handle an exception that occurred while the job was running. + * + * @param string $connection + * @param \Illuminate\Contracts\Queue\Job $job + * @param int $delay + * @param \Throwable $e + * @return void + * + * @throws \Throwable + */ + protected function handleJobException($connection, Job $job, $delay, $e) + { + // If we catch an exception, we will attempt to release the job back onto + // the queue so it is not lost. This will let is be retried at a later + // time by another listener (or the same one). We will do that here. + try { + $this->raiseExceptionOccurredJobEvent( + $connection, $job, $e + ); + } finally { if (! $job->isDeleted()) { $job->release($delay); } + } - throw $e; + throw $e; + } + + /** + * Raise the before queue job event. + * + * @param string $connection + * @param \Illuminate\Contracts\Queue\Job $job + * @return void + */ + protected function raiseBeforeJobEvent($connection, Job $job) + { + if ($this->events) { + $data = json_decode($job->getRawBody(), true); + + $this->events->fire(new Events\JobProcessing($connection, $job, $data)); } } @@ -250,7 +279,24 @@ protected function raiseAfterJobEvent($connection, Job $job) if ($this->events) { $data = json_decode($job->getRawBody(), true); - $this->events->fire('illuminate.queue.after', [$connection, $job, $data]); + $this->events->fire(new Events\JobProcessed($connection, $job, $data)); + } + } + + /** + * Raise the exception occurred queue job event. + * + * @param string $connection + * @param \Illuminate\Contracts\Queue\Job $job + * @param \Throwable $exception + * @return void + */ + protected function raiseExceptionOccurredJobEvent($connection, Job $job, $exception) + { + if ($this->events) { + $data = json_decode($job->getRawBody(), true); + + $this->events->fire(new Events\JobExceptionOccurred($connection, $job, $data, $exception)); } } @@ -264,13 +310,13 @@ protected function raiseAfterJobEvent($connection, Job $job) protected function logFailedJob($connection, Job $job) { if ($this->failer) { - $this->failer->log($connection, $job->getQueue(), $job->getRawBody()); + $failedId = $this->failer->log($connection, $job->getQueue(), $job->getRawBody()); $job->delete(); $job->failed(); - $this->raiseFailedJobEvent($connection, $job); + $this->raiseFailedJobEvent($connection, $job, $failedId); } return ['job' => $job, 'failed' => true]; @@ -281,14 +327,15 @@ protected function logFailedJob($connection, Job $job) * * @param string $connection * @param \Illuminate\Contracts\Queue\Job $job + * @param int|null $failedId * @return void */ - protected function raiseFailedJobEvent($connection, Job $job) + protected function raiseFailedJobEvent($connection, Job $job, $failedId) { if ($this->events) { $data = json_decode($job->getRawBody(), true); - $this->events->fire('illuminate.queue.failed', [$connection, $job, $data]); + $this->events->fire(new Events\JobFailed($connection, $job, $data, $failedId)); } } @@ -310,7 +357,7 @@ public function memoryExceeded($memoryLimit) */ public function stop() { - $this->events->fire('illuminate.queue.stopping'); + $this->events->fire(new Events\WorkerStopping); die; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Queue/composer.json b/application/vendor/laravel/framework/src/Illuminate/Queue/composer.json index 84f2edd..843f728 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Queue/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Queue/composer.json @@ -10,19 +10,18 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/console": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/container": "5.1.*", - "illuminate/http": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/process": "2.7.*", - "symfony/debug": "2.7.*", - "nesbot/carbon": "~1.19" + "illuminate/console": "5.2.*", + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "nesbot/carbon": "~1.20", + "symfony/debug": "2.8.*|3.0.*", + "symfony/process": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -34,14 +33,13 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver (~3.0).", - "illuminate/redis": "Required to use the redis queue driver (5.1.*).", - "iron-io/iron_mq": "Required to use the iron queue driver (~2.0).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0)." + "illuminate/redis": "Required to use the Redis queue driver (5.2.*).", + "pda/pheanstalk": "Required to use the Beanstalk queue driver (~3.0)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Redis/Database.php b/application/vendor/laravel/framework/src/Illuminate/Redis/Database.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Redis/composer.json b/application/vendor/laravel/framework/src/Illuminate/Redis/composer.json old mode 100644 new mode 100755 index b78240b..96b87c6 --- a/application/vendor/laravel/framework/src/Illuminate/Redis/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Redis/composer.json @@ -10,13 +10,13 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", "predis/predis": "~1.0" }, "autoload": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php old mode 100644 new mode 100755 index 8ff71e8..e2dd703 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php @@ -19,7 +19,7 @@ class ControllerMakeCommand extends GeneratorCommand * * @var string */ - protected $description = 'Create a new resource controller class'; + protected $description = 'Create a new controller class'; /** * The type of class being generated. @@ -35,11 +35,11 @@ class ControllerMakeCommand extends GeneratorCommand */ protected function getStub() { - if ($this->option('plain')) { - return __DIR__.'/stubs/controller.plain.stub'; + if ($this->option('resource')) { + return __DIR__.'/stubs/controller.stub'; } - return __DIR__.'/stubs/controller.stub'; + return __DIR__.'/stubs/controller.plain.stub'; } /** @@ -61,7 +61,22 @@ protected function getDefaultNamespace($rootNamespace) protected function getOptions() { return [ - ['plain', null, InputOption::VALUE_NONE, 'Generate an empty controller class.'], + ['resource', null, InputOption::VALUE_NONE, 'Generate a resource controller class.'], ]; } + + /** + * Build the class with the given name. + * + * Remove the base controller import if we are already in base namespace. + * + * @param string $name + * @return string + */ + protected function buildClass($name) + { + $namespace = $this->getNamespace($name); + + return str_replace("use $namespace\Controller;\n", '', parent::buildClass($name)); + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Controller.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Controller.php index 67ef890..8e3e47f 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/Controller.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Controller.php @@ -2,10 +2,7 @@ namespace Illuminate\Routing; -use Closure; use BadMethodCallException; -use Illuminate\Support\Str; -use InvalidArgumentException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; abstract class Controller @@ -17,20 +14,6 @@ abstract class Controller */ protected $middleware = []; - /** - * The "before" filters registered on the controller. - * - * @var array - */ - protected $beforeFilters = []; - - /** - * The "after" filters registered on the controller. - * - * @var array - */ - protected $afterFilters = []; - /** * The router instance. * @@ -41,152 +24,17 @@ abstract class Controller /** * Register middleware on the controller. * - * @param string $middleware + * @param array|string $middleware * @param array $options - * @return void + * @return \Illuminate\Routing\ControllerMiddlewareOptions */ public function middleware($middleware, array $options = []) { - $this->middleware[$middleware] = $options; - } - - /** - * Register a "before" filter on the controller. - * - * @param \Closure|string $filter - * @param array $options - * @return void - * - * @deprecated since version 5.1. - */ - public function beforeFilter($filter, array $options = []) - { - $this->beforeFilters[] = $this->parseFilter($filter, $options); - } - - /** - * Register an "after" filter on the controller. - * - * @param \Closure|string $filter - * @param array $options - * @return void - * - * @deprecated since version 5.1. - */ - public function afterFilter($filter, array $options = []) - { - $this->afterFilters[] = $this->parseFilter($filter, $options); - } - - /** - * Parse the given filter and options. - * - * @param \Closure|string $filter - * @param array $options - * @return array - */ - protected function parseFilter($filter, array $options) - { - $parameters = []; - - $original = $filter; - - if ($filter instanceof Closure) { - $filter = $this->registerClosureFilter($filter); - } elseif ($this->isInstanceFilter($filter)) { - $filter = $this->registerInstanceFilter($filter); - } else { - list($filter, $parameters) = Route::parseFilter($filter); + foreach ((array) $middleware as $middlewareName) { + $this->middleware[$middlewareName] = &$options; } - return compact('original', 'filter', 'parameters', 'options'); - } - - /** - * Register an anonymous controller filter Closure. - * - * @param \Closure $filter - * @return string - */ - protected function registerClosureFilter(Closure $filter) - { - $this->getRouter()->filter($name = spl_object_hash($filter), $filter); - - return $name; - } - - /** - * Register a controller instance method as a filter. - * - * @param string $filter - * @return string - */ - protected function registerInstanceFilter($filter) - { - $this->getRouter()->filter($filter, [$this, substr($filter, 1)]); - - return $filter; - } - - /** - * Determine if a filter is a local method on the controller. - * - * @param mixed $filter - * @return bool - * - * @throws \InvalidArgumentException - */ - protected function isInstanceFilter($filter) - { - if (is_string($filter) && Str::startsWith($filter, '@')) { - if (method_exists($this, substr($filter, 1))) { - return true; - } - - throw new InvalidArgumentException("Filter method [$filter] does not exist."); - } - - return false; - } - - /** - * Remove the given before filter. - * - * @param string $filter - * @return void - * - * @deprecated since version 5.1. - */ - public function forgetBeforeFilter($filter) - { - $this->beforeFilters = $this->removeFilter($filter, $this->getBeforeFilters()); - } - - /** - * Remove the given after filter. - * - * @param string $filter - * @return void - * - * @deprecated since version 5.1. - */ - public function forgetAfterFilter($filter) - { - $this->afterFilters = $this->removeFilter($filter, $this->getAfterFilters()); - } - - /** - * Remove the given controller filter from the provided filter array. - * - * @param string $removing - * @param array $current - * @return array - */ - protected function removeFilter($removing, $current) - { - return array_filter($current, function ($filter) use ($removing) { - return $filter['original'] != $removing; - }); + return new ControllerMiddlewareOptions($options); } /** @@ -199,30 +47,6 @@ public function getMiddleware() return $this->middleware; } - /** - * Get the registered "before" filters. - * - * @return array - * - * @deprecated since version 5.1. - */ - public function getBeforeFilters() - { - return $this->beforeFilters; - } - - /** - * Get the registered "after" filters. - * - * @return array - * - * @deprecated since version 5.1. - */ - public function getAfterFilters() - { - return $this->afterFilters; - } - /** * Get the router instance. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php index 6482868..5893a37 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php @@ -2,10 +2,8 @@ namespace Illuminate\Routing; -use Closure; -use Illuminate\Support\Arr; use Illuminate\Http\Request; -use Illuminate\Pipeline\Pipeline; +use Illuminate\Support\Collection; use Illuminate\Container\Container; class ControllerDispatcher @@ -51,25 +49,9 @@ public function __construct(Router $router, */ public function dispatch(Route $route, Request $request, $controller, $method) { - // First we will make an instance of this controller via the IoC container instance - // so that we can call the methods on it. We will also apply any "after" filters - // to the route so that they will be run by the routers after this processing. $instance = $this->makeController($controller); - $this->assignAfter($instance, $route, $request, $method); - - $response = $this->before($instance, $route, $request, $method); - - // If no before filters returned a response we'll call the method on the controller - // to get the response to be returned to the router. We will then return it back - // out for processing by this router and the after filters can be called then. - if (is_null($response)) { - $response = $this->callWithinStack( - $instance, $route, $request, $method - ); - } - - return $response; + return $this->callWithinStack($instance, $route, $request, $method); } /** @@ -121,9 +103,9 @@ protected function callWithinStack($instance, $route, $request, $method) * @param string $method * @return array */ - protected function getMiddleware($instance, $method) + public function getMiddleware($instance, $method) { - $results = []; + $results = new Collection; foreach ($instance->getMiddleware() as $name => $options) { if (! $this->methodExcludedByOptions($method, $options)) { @@ -131,7 +113,7 @@ protected function getMiddleware($instance, $method) } } - return $results; + return $results->flatten()->all(); } /** @@ -163,138 +145,4 @@ protected function call($instance, $route, $method) return $instance->callAction($method, $parameters); } - - /** - * Call the "before" filters for the controller. - * - * @param \Illuminate\Routing\Controller $instance - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @param string $method - * @return mixed - */ - protected function before($instance, $route, $request, $method) - { - foreach ($instance->getBeforeFilters() as $filter) { - if ($this->filterApplies($filter, $request, $method)) { - // Here we will just check if the filter applies. If it does we will call the filter - // and return the responses if it isn't null. If it is null, we will keep hitting - // them until we get a response or are finished iterating through this filters. - $response = $this->callFilter($filter, $route, $request); - - if (! is_null($response)) { - return $response; - } - } - } - } - - /** - * Apply the applicable after filters to the route. - * - * @param \Illuminate\Routing\Controller $instance - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @param string $method - * @return mixed - */ - protected function assignAfter($instance, $route, $request, $method) - { - foreach ($instance->getAfterFilters() as $filter) { - // If the filter applies, we will add it to the route, since it has already been - // registered with the router by the controller, and will just let the normal - // router take care of calling these filters so we do not duplicate logics. - if ($this->filterApplies($filter, $request, $method)) { - $route->after($this->getAssignableAfter($filter)); - } - } - } - - /** - * Get the assignable after filter for the route. - * - * @param \Closure|string $filter - * @return string - */ - protected function getAssignableAfter($filter) - { - if ($filter['original'] instanceof Closure) { - return $filter['filter']; - } - - return $filter['original']; - } - - /** - * Determine if the given filter applies to the request. - * - * @param array $filter - * @param \Illuminate\Http\Request $request - * @param string $method - * @return bool - */ - protected function filterApplies($filter, $request, $method) - { - foreach (['Method', 'On'] as $type) { - if ($this->{"filterFails{$type}"}($filter, $request, $method)) { - return false; - } - } - - return true; - } - - /** - * Determine if the filter fails the method constraints. - * - * @param array $filter - * @param \Illuminate\Http\Request $request - * @param string $method - * @return bool - */ - protected function filterFailsMethod($filter, $request, $method) - { - return $this->methodExcludedByOptions($method, $filter['options']); - } - - /** - * Determine if the filter fails the "on" constraint. - * - * @param array $filter - * @param \Illuminate\Http\Request $request - * @param string $method - * @return bool - */ - protected function filterFailsOn($filter, $request, $method) - { - $on = Arr::get($filter, 'options.on'); - - if (is_null($on)) { - return false; - } - - // If the "on" is a string, we will explode it on the pipe so you can set any - // amount of methods on the filter constraints and it will still work like - // you specified an array. Then we will check if the method is in array. - if (is_string($on)) { - $on = explode('|', $on); - } - - return ! in_array(strtolower($request->getMethod()), $on); - } - - /** - * Call the given controller filter method. - * - * @param array $filter - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @return mixed - */ - protected function callFilter($filter, $route, $request) - { - return $this->router->callRouteFilter( - $filter['filter'], $filter['parameters'], $route, $request - ); - } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerInspector.php b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerInspector.php index bf6ff39..470dc91 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerInspector.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerInspector.php @@ -6,6 +6,9 @@ use ReflectionMethod; use Illuminate\Support\Str; +/** + * @deprecated since version 5.2. + */ class ControllerInspector { /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php new file mode 100644 index 0000000..13ef189 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php @@ -0,0 +1,50 @@ +options = &$options; + } + + /** + * Set the controller methods the middleware should apply to. + * + * @param array|string|dynamic $methods + * @return $this + */ + public function only($methods) + { + $this->options['only'] = is_array($methods) ? $methods : func_get_args(); + + return $this; + } + + /** + * Set the controller methods the middleware should exclude. + * + * @param array|string|dynamic $methods + * @return $this + */ + public function except($methods) + { + $this->options['except'] = is_array($methods) ? $methods : func_get_args(); + + return $this; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php deleted file mode 100644 index ead0992..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/ControllerServiceProvider.php +++ /dev/null @@ -1,20 +0,0 @@ -app->singleton('illuminate.route.dispatcher', function ($app) { - return new ControllerDispatcher($app['router'], $app); - }); - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php new file mode 100644 index 0000000..c848607 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php @@ -0,0 +1,33 @@ +route = $route; + $this->request = $request; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php new file mode 100644 index 0000000..e5b37b7 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php @@ -0,0 +1,19 @@ +getName()}] [URI: {$route->getPath()}]."); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/GeneratorServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Routing/GeneratorServiceProvider.php deleted file mode 100644 index 1b5bfea..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/GeneratorServiceProvider.php +++ /dev/null @@ -1,67 +0,0 @@ -registerControllerGenerator(); - - $this->registerMiddlewareGenerator(); - - $this->commands('command.controller.make', 'command.middleware.make'); - } - - /** - * Register the controller generator command. - * - * @return void - */ - protected function registerControllerGenerator() - { - $this->app->singleton('command.controller.make', function ($app) { - return new ControllerMakeCommand($app['files']); - }); - } - - /** - * Register the middleware generator command. - * - * @return void - */ - protected function registerMiddlewareGenerator() - { - $this->app->singleton('command.middleware.make', function ($app) { - return new MiddlewareMakeCommand($app['files']); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'command.controller.make', 'command.middleware.make', - ]; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php new file mode 100644 index 0000000..8cfc54c --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php @@ -0,0 +1,128 @@ +limiter = $limiter; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param int $maxAttempts + * @param int $decayMinutes + * @return mixed + */ + public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes = 1) + { + $key = $this->resolveRequestSignature($request); + + if ($this->limiter->tooManyAttempts($key, $maxAttempts, $decayMinutes)) { + return $this->buildResponse($key, $maxAttempts); + } + + $this->limiter->hit($key, $decayMinutes); + + $response = $next($request); + + return $this->addHeaders( + $response, $maxAttempts, + $this->calculateRemainingAttempts($key, $maxAttempts) + ); + } + + /** + * Resolve request signature. + * + * @param \Illuminate\Http\Request $request + * @return string + */ + protected function resolveRequestSignature($request) + { + return $request->fingerprint(); + } + + /** + * Create a 'too many attempts' response. + * + * @param string $key + * @param int $maxAttempts + * @return \Illuminate\Http\Response + */ + protected function buildResponse($key, $maxAttempts) + { + $response = new Response('Too Many Attempts.', 429); + + $retryAfter = $this->limiter->availableIn($key); + + return $this->addHeaders( + $response, $maxAttempts, + $this->calculateRemainingAttempts($key, $maxAttempts, $retryAfter), + $retryAfter + ); + } + + /** + * Add the limit header information to the given response. + * + * @param \Symfony\Component\HttpFoundation\Response $response + * @param int $maxAttempts + * @param int $remainingAttempts + * @param int|null $retryAfter + * @return \Illuminate\Http\Response + */ + protected function addHeaders(Response $response, $maxAttempts, $remainingAttempts, $retryAfter = null) + { + $headers = [ + 'X-RateLimit-Limit' => $maxAttempts, + 'X-RateLimit-Remaining' => $remainingAttempts, + ]; + + if (! is_null($retryAfter)) { + $headers['Retry-After'] = $retryAfter; + } + + $response->headers->add($headers); + + return $response; + } + + /** + * Calculate the number of remaining attempts. + * + * @param string $key + * @param int $maxAttempts + * @param int|null $retryAfter + * @return int + */ + protected function calculateRemainingAttempts($key, $maxAttempts, $retryAfter = null) + { + if (! is_null($retryAfter)) { + return 0; + } + + return $this->limiter->retriesLeft($key, $maxAttempts); + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php new file mode 100644 index 0000000..1d928c7 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php @@ -0,0 +1,88 @@ +handleException($passable, $e); + } catch (Throwable $e) { + return $this->handleException($passable, new FatalThrowableError($e)); + } + }; + }; + } + + /** + * Get the initial slice to begin the stack call. + * + * @param \Closure $destination + * @return \Closure + */ + protected function getInitialSlice(Closure $destination) + { + return function ($passable) use ($destination) { + try { + return call_user_func($destination, $passable); + } catch (Exception $e) { + return $this->handleException($passable, $e); + } catch (Throwable $e) { + return $this->handleException($passable, new FatalThrowableError($e)); + } + }; + } + + /** + * Handle the given exception. + * + * @param mixed $passable + * @param \Exception $e + * @return mixed + * + * @throws \Exception + */ + protected function handleException($passable, Exception $e) + { + if (! $this->container->bound(ExceptionHandler::class) || ! $passable instanceof Request) { + throw $e; + } + + $handler = $this->container->make(ExceptionHandler::class); + + $handler->report($e); + + $response = $handler->render($passable, $e); + + if (method_exists($response, 'withException')) { + $response->withException($e); + } + + return $response; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Redirector.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Redirector.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php b/application/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php index bd46c9a..f2725dd 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/ResourceRegistrar.php @@ -20,6 +20,27 @@ class ResourceRegistrar */ protected $resourceDefaults = ['index', 'create', 'store', 'show', 'edit', 'update', 'destroy']; + /** + * The parameters set for this resource instance. + * + * @var array|string + */ + protected $parameters; + + /** + * The global parameter mapping. + * + * @var array + */ + protected static $parameterMap = []; + + /** + * Singular global parameters. + * + * @var bool + */ + protected static $singularParameters = false; + /** * Create a new resource registrar instance. * @@ -41,6 +62,10 @@ public function __construct(Router $router) */ public function register($name, $controller, array $options = []) { + if (isset($options['parameters']) && ! isset($this->parameters)) { + $this->parameters = $options['parameters']; + } + // If the resource name contains a slash, we will assume the developer wishes to // register these resource routes with a prefix so we will set that up out of // the box so they don't have to mess with it. Otherwise, we will continue. @@ -52,7 +77,7 @@ public function register($name, $controller, array $options = []) // We need to extract the base resource from the resource name. Nested resources // are supported in the framework, but we need to know what name to use for a - // place-holder on the route wildcards, which should be the base resources. + // place-holder on the route parameters, which should be the base resources. $base = $this->getResourceWildcard(last(explode('.', $name))); $defaults = $this->resourceDefaults; @@ -76,7 +101,7 @@ protected function prefixedResource($name, $controller, array $options) // We need to extract the base resource from the resource name. Nested resources // are supported in the framework, but we need to know what name to use for a - // place-holder on the route wildcards, which should be the base resources. + // place-holder on the route parameters, which should be the base resources. $callback = function ($me) use ($name, $controller, $options) { $me->resource($name, $controller, $options); }; @@ -132,9 +157,9 @@ public function getResourceUri($resource) return $resource; } - // Once we have built the base URI, we'll remove the wildcard holder for this + // Once we have built the base URI, we'll remove the parameter holder for this // base resource name so that the individual route adders can suffix these - // paths however they need to, as some do not have any wildcards at all. + // paths however they need to, as some do not have any parameters at all. $segments = explode('.', $resource); $uri = $this->getNestedResourceUri($segments); @@ -220,13 +245,21 @@ protected function getGroupResourceName($prefix, $resource, $method) } /** - * Format a resource wildcard for usage. + * Format a resource parameter for usage. * * @param string $value * @return string */ public function getResourceWildcard($value) { + if (isset($this->parameters[$value])) { + $value = $this->parameters[$value]; + } elseif (isset(static::$parameterMap[$value])) { + $value = static::$parameterMap[$value]; + } elseif ($this->parameters === 'singular' || static::$singularParameters) { + $value = Str::singular($value); + } + return str_replace('-', '_', $value); } @@ -327,17 +360,19 @@ protected function addResourceEdit($name, $base, $controller, $options) * @param string $base * @param string $controller * @param array $options - * @return void + * @return \Illuminate\Routing\Route */ protected function addResourceUpdate($name, $base, $controller, $options) { - $this->addPutResourceUpdate($name, $base, $controller, $options); + $uri = $this->getResourceUri($name).'/{'.$base.'}'; - return $this->addPatchResourceUpdate($name, $base, $controller); + $action = $this->getResourceAction($name, $controller, 'update', $options); + + return $this->router->match(['PUT', 'PATCH'], $uri, $action); } /** - * Add the update method for a resourceful route. + * Add the destroy method for a resourceful route. * * @param string $name * @param string $base @@ -345,45 +380,43 @@ protected function addResourceUpdate($name, $base, $controller, $options) * @param array $options * @return \Illuminate\Routing\Route */ - protected function addPutResourceUpdate($name, $base, $controller, $options) + protected function addResourceDestroy($name, $base, $controller, $options) { $uri = $this->getResourceUri($name).'/{'.$base.'}'; - $action = $this->getResourceAction($name, $controller, 'update', $options); + $action = $this->getResourceAction($name, $controller, 'destroy', $options); - return $this->router->put($uri, $action); + return $this->router->delete($uri, $action); } /** - * Add the update method for a resourceful route. + * Set or unset the unmapped global parameters to singular. * - * @param string $name - * @param string $base - * @param string $controller * @return void */ - protected function addPatchResourceUpdate($name, $base, $controller) + public static function singularParameters($singular = true) { - $uri = $this->getResourceUri($name).'/{'.$base.'}'; - - $this->router->patch($uri, $controller.'@update'); + static::$singularParameters = (bool) $singular; } /** - * Add the destroy method for a resourceful route. + * Get the global parameter map. * - * @param string $name - * @param string $base - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\Route + * @return array */ - protected function addResourceDestroy($name, $base, $controller, $options) + public static function getParameters() { - $uri = $this->getResourceUri($name).'/{'.$base.'}'; - - $action = $this->getResourceAction($name, $controller, 'destroy', $options); + return static::$parameterMap; + } - return $this->router->delete($uri, $action); + /** + * Set the global parameter mapping. + * + * @param array $parameters + * @return void + */ + public static function setParameters(array $parameters = []) + { + static::$parameterMap = $parameters; } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php b/application/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php index 02e77cb..b97be05 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php @@ -137,6 +137,18 @@ public function download($file, $name = null, array $headers = [], $disposition return $response; } + /** + * Return the raw contents of a binary file. + * + * @param \SplFileInfo|string $file + * @param array $headers + * @return \Symfony\Component\HttpFoundation\BinaryFileResponse + */ + public function file($file, array $headers = []) + { + return new BinaryFileResponse($file, 200, $headers); + } + /** * Create a new redirect response to the given path. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Route.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Route.php old mode 100644 new mode 100755 index cd4627a..946484d --- a/application/vendor/laravel/framework/src/Illuminate/Routing/Route.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Route.php @@ -4,6 +4,7 @@ use Closure; use LogicException; +use ReflectionMethod; use ReflectionFunction; use Illuminate\Support\Arr; use Illuminate\Support\Str; @@ -14,9 +15,8 @@ use Illuminate\Routing\Matching\HostValidator; use Illuminate\Routing\Matching\MethodValidator; use Illuminate\Routing\Matching\SchemeValidator; -use Illuminate\Http\Exception\HttpResponseException; use Symfony\Component\Routing\Route as SymfonyRoute; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Illuminate\Http\Exception\HttpResponseException; class Route { @@ -78,6 +78,13 @@ class Route */ protected $compiled; + /** + * The router instance used by the route. + * + * @var \Illuminate\Routing\Router + */ + protected $router; + /** * The container instance used by the route. * @@ -95,7 +102,7 @@ class Route /** * Create a new Route instance. * - * @param array $methods + * @param array|string $methods * @param string $uri * @param \Closure|array $action * @return void @@ -130,10 +137,6 @@ public function run(Request $request) return $this->runCallable($request); } - if ($this->customDispatcherIsBound()) { - return $this->runWithCustomDispatcher($request); - } - return $this->runController($request); } catch (HttpResponseException $e) { return $e->getResponse(); @@ -167,40 +170,8 @@ protected function runController(Request $request) { list($class, $method) = explode('@', $this->action['uses']); - $parameters = $this->resolveClassMethodDependencies( - $this->parametersWithoutNulls(), $class, $method - ); - - if (! method_exists($instance = $this->container->make($class), $method)) { - throw new NotFoundHttpException; - } - - return call_user_func_array([$instance, $method], $parameters); - } - - /** - * Determine if a custom route dispatcher is bound in the container. - * - * @return bool - */ - protected function customDispatcherIsBound() - { - return $this->container->bound('illuminate.route.dispatcher'); - } - - /** - * Send the request and route to a custom dispatcher for handling. - * - * @param \Illuminate\Http\Request $request - * @return mixed - */ - protected function runWithCustomDispatcher(Request $request) - { - list($class, $method) = explode('@', $this->action['uses']); - - $dispatcher = $this->container->make('illuminate.route.dispatcher'); - - return $dispatcher->dispatch($this, $request, $class, $method); + return (new ControllerDispatcher($this->router, $this->container)) + ->dispatch($this, $request, $class, $method); } /** @@ -238,10 +209,8 @@ protected function compileRoute() $uri = preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri); - $this->compiled = with( - + $this->compiled = ( new SymfonyRoute($uri, $optionals, $this->wheres, [], $this->domain() ?: '') - )->compile(); } @@ -281,112 +250,51 @@ public function middleware($middleware = null) } /** - * Get the "before" filters for the route. + * Get the controller middleware for the route. * * @return array - * - * @deprecated since version 5.1. */ - public function beforeFilters() + protected function controllerMiddleware() { - if (! isset($this->action['before'])) { - return []; - } - - return $this->parseFilters($this->action['before']); - } - - /** - * Get the "after" filters for the route. - * - * @return array - * - * @deprecated since version 5.1. - */ - public function afterFilters() - { - if (! isset($this->action['after'])) { - return []; - } - - return $this->parseFilters($this->action['after']); - } - - /** - * Parse the given filter string. - * - * @param string $filters - * @return array - * - * @deprecated since version 5.1. - */ - public static function parseFilters($filters) - { - return Arr::build(static::explodeFilters($filters), function ($key, $value) { - return Route::parseFilter($value); - }); - } + list($class, $method) = explode('@', $this->action['uses']); - /** - * Turn the filters into an array if they aren't already. - * - * @param array|string $filters - * @return array - */ - protected static function explodeFilters($filters) - { - if (is_array($filters)) { - return static::explodeArrayFilters($filters); - } + $controller = $this->container->make($class); - return array_map('trim', explode('|', $filters)); + return (new ControllerDispatcher($this->router, $this->container)) + ->getMiddleware($controller, $method); } /** - * Flatten out an array of filter declarations. + * Get the parameters that are listed in the route / controller signature. * - * @param array $filters + * @param string|null $subClass * @return array */ - protected static function explodeArrayFilters(array $filters) + public function signatureParameters($subClass = null) { - $results = []; - - foreach ($filters as $filter) { - $results = array_merge($results, array_map('trim', explode('|', $filter))); - } + $action = $this->getAction(); - return $results; - } + if (is_string($action['uses'])) { + list($class, $method) = explode('@', $action['uses']); - /** - * Parse the given filter into name and parameters. - * - * @param string $filter - * @return array - * - * @deprecated since version 5.1. - */ - public static function parseFilter($filter) - { - if (! Str::contains($filter, ':')) { - return [$filter, []]; + $parameters = (new ReflectionMethod($class, $method))->getParameters(); + } else { + $parameters = (new ReflectionFunction($action['uses']))->getParameters(); } - return static::parseParameterFilter($filter); + return is_null($subClass) ? $parameters : array_filter($parameters, function ($p) use ($subClass) { + return $p->getClass() && $p->getClass()->isSubclassOf($subClass); + }); } /** - * Parse a filter with parameters. + * Determine if the route has parameters. * - * @param string $filter - * @return array + * @return bool */ - protected static function parseParameterFilter($filter) + public function hasParameters() { - list($name, $parameters) = explode(':', $filter, 2); - - return [$name, explode(',', $parameters)]; + return isset($this->parameters); } /** @@ -397,6 +305,10 @@ protected static function parseParameterFilter($filter) */ public function hasParameter($name) { + if (! $this->hasParameters()) { + return false; + } + return array_key_exists($name, $this->parameters()); } @@ -461,9 +373,7 @@ public function forgetParameter($name) public function parameters() { if (isset($this->parameters)) { - return array_map(function ($value) { - return is_string($value) ? rawurldecode($value) : $value; - }, $this->parameters); + return $this->parameters; } throw new LogicException('Route is not bound.'); @@ -536,9 +446,7 @@ public function bindParameters(Request $request) // compile that and get the parameter matches for this domain. We will then // merge them into this parameters array so that this array is completed. $params = $this->matchToKeys( - array_slice($this->bindPathParameters($request), 1) - ); // If the route has a regular expression for the host part of the URI, we will @@ -588,11 +496,11 @@ protected function bindHostParameters(Request $request, $parameters) */ protected function matchToKeys(array $matches) { - if (count($this->parameterNames()) == 0) { + if (empty($parameterNames = $this->parameterNames())) { return []; } - $parameters = array_intersect_key($matches, array_flip($this->parameterNames())); + $parameters = array_intersect_key($matches, array_flip($parameterNames)); return array_filter($parameters, function ($value) { return is_string($value) && strlen($value) > 0; @@ -607,8 +515,8 @@ protected function matchToKeys(array $matches) */ protected function replaceDefaults(array $parameters) { - foreach ($parameters as $key => &$value) { - $value = isset($value) ? $value : Arr::get($this->defaults, $key); + foreach ($parameters as $key => $value) { + $parameters[$key] = isset($value) ? $value : Arr::get($this->defaults, $key); } foreach ($this->defaults as $key => $value) { @@ -623,13 +531,22 @@ protected function replaceDefaults(array $parameters) /** * Parse the route action into a standard array. * - * @param callable|array $action + * @param callable|array|null $action * @return array * * @throws \UnexpectedValueException */ protected function parseAction($action) { + // If no action is passed in right away, we assume the user will make use of + // fluent routing. In that case, we set a default closure, to be executed + // if the user never explicitly sets an action to handle the given uri. + if (is_null($action)) { + return ['uses' => function () { + throw new LogicException("Route for [{$this->uri}] has no action."); + }]; + } + // If the action is already a Closure instance, we will just set that instance // as the "uses" property, because there is nothing else we need to do when // it is available. Otherwise we will need to find it in the action list. @@ -686,54 +603,6 @@ public static function getValidators() ]; } - /** - * Add before filters to the route. - * - * @param string $filters - * @return $this - * - * @deprecated since version 5.1. - */ - public function before($filters) - { - return $this->addFilters('before', $filters); - } - - /** - * Add after filters to the route. - * - * @param string $filters - * @return $this - * - * @deprecated since version 5.1. - */ - public function after($filters) - { - return $this->addFilters('after', $filters); - } - - /** - * Add the given filters to the route by type. - * - * @param string $type - * @param string $filters - * @return $this - */ - protected function addFilters($type, $filters) - { - $filters = static::explodeFilters($filters); - - if (isset($this->action[$type])) { - $existing = static::explodeFilters($this->action[$type]); - - $this->action[$type] = array_merge($existing, $filters); - } else { - $this->action[$type] = $filters; - } - - return $this; - } - /** * Set a default value for the route. * @@ -900,7 +769,7 @@ public function getUri() * Set the URI that the route responds to. * * @param string $uri - * @return \Illuminate\Routing\Route + * @return $this */ public function setUri($uri) { @@ -942,6 +811,39 @@ public function name($name) return $this; } + /** + * Set the handler for the route. + * + * @param \Closure|string $action + * @return $this + */ + public function uses($action) + { + $action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action; + + return $this->setAction(array_merge($this->action, $this->parseAction([ + 'uses' => $action, + 'controller' => $action, + ]))); + } + + /** + * Parse a string based action for the "uses" fluent method. + * + * @param string $action + * @return string + */ + protected function addGroupNamespaceToStringUses($action) + { + $groupStack = last($this->router->getGroupStack()); + + if (isset($groupStack['namespace']) && strpos($action, '\\') !== 0) { + return $groupStack['namespace'].'\\'.$action; + } + + return $action; + } + /** * Get the action name for the route. * @@ -985,6 +887,19 @@ public function getCompiled() return $this->compiled; } + /** + * Set the router instance on the route. + * + * @param \Illuminate\Routing\Router $router + * @return $this + */ + public function setRouter(Router $router) + { + $this->router = $router; + + return $this; + } + /** * Set the container instance on the route. * @@ -1011,7 +926,7 @@ public function prepareForSerialization() throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure."); } - unset($this->container, $this->compiled); + unset($this->router, $this->container, $this->compiled); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php b/application/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php index 4821a1f..c28b3c5 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php @@ -192,7 +192,7 @@ protected function checkForAlternateVerbs($request) * @param array $methods * @return \Illuminate\Routing\Route * - * @throws \Symfony\Component\Routing\Exception\MethodNotAllowedHttpException + * @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException */ protected function getRouteForMethods($request, array $methods) { @@ -239,7 +239,7 @@ protected function check(array $routes, $request, $includingMethod = true) * @param string|null $method * @return array */ - protected function get($method = null) + public function get($method = null) { if (is_null($method)) { return $this->getRoutes(); @@ -291,6 +291,16 @@ public function getRoutes() return array_values($this->allRoutes); } + /** + * Get all of the routes keyed by their HTTP verb / method. + * + * @return array + */ + public function getRoutesByMethod() + { + return $this->routes; + } + /** * Get an iterator for the items. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php b/application/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php index 9ab742a..058ac1e 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php @@ -2,12 +2,10 @@ namespace Illuminate\Routing; -use ReflectionClass; use ReflectionMethod; use ReflectionParameter; use Illuminate\Support\Arr; use ReflectionFunctionAbstract; -use Illuminate\Database\Eloquent\Model; trait RouteDependencyResolverTrait { @@ -88,36 +86,6 @@ protected function transformDependency(ReflectionParameter $parameter, $paramete } } - /** - * Determine if the given type-hinted class is an implict Eloquent binding. - * - * Must not already be resolved in the parameter list by an explicit model binding. - * - * @param \ReflectionClass $class - * @param array $parameters - * @return bool - */ - protected function vacantEloquentParameter(ReflectionClass $class, array $parameters) - { - return $class->isSubclassOf(Model::class) && - ! $this->alreadyInParameters($class->name, $parameters); - } - - /** - * Extract an implicit model binding's key out of the parameter list. - * - * @param \ReflectionParameter $parameter - * @param array $originalParameters - * - * @return mixed - */ - protected function extractModelIdentifier(ReflectionParameter $parameter, array $originalParameters) - { - return Arr::first($originalParameters, function ($parameterKey) use ($parameter) { - return $parameterKey === $parameter->name; - }); - } - /** * Determine if an object of the given class is in a list of parameters. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/Router.php b/application/vendor/laravel/framework/src/Illuminate/Routing/Router.php old mode 100644 new mode 100755 index d6aacb4..f527f4a --- a/application/vendor/laravel/framework/src/Illuminate/Routing/Router.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/Router.php @@ -7,14 +7,14 @@ use Illuminate\Support\Str; use Illuminate\Http\Request; use Illuminate\Http\Response; -use Illuminate\Pipeline\Pipeline; use Illuminate\Support\Collection; use Illuminate\Container\Container; +use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Traits\Macroable; use Illuminate\Contracts\Events\Dispatcher; use Psr\Http\Message\ResponseInterface as PsrResponseInterface; -use Illuminate\Contracts\Routing\Registrar as RegistrarContract; use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory; +use Illuminate\Contracts\Routing\Registrar as RegistrarContract; use Symfony\Component\HttpFoundation\Response as SymfonyResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -65,18 +65,11 @@ class Router implements RegistrarContract protected $middleware = []; /** - * The registered pattern based filters. - * - * @var array - */ - protected $patternFilters = []; - - /** - * The registered regular expression based filters. + * All of the middleware groups. * * @var array */ - protected $regexFilters = []; + protected $middlewareGroups = []; /** * The registered route value binders. @@ -128,10 +121,10 @@ public function __construct(Dispatcher $events, Container $container = null) * Register a new GET route with the router. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function get($uri, $action) + public function get($uri, $action = null) { return $this->addRoute(['GET', 'HEAD'], $uri, $action); } @@ -140,10 +133,10 @@ public function get($uri, $action) * Register a new POST route with the router. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function post($uri, $action) + public function post($uri, $action = null) { return $this->addRoute('POST', $uri, $action); } @@ -152,10 +145,10 @@ public function post($uri, $action) * Register a new PUT route with the router. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function put($uri, $action) + public function put($uri, $action = null) { return $this->addRoute('PUT', $uri, $action); } @@ -164,10 +157,10 @@ public function put($uri, $action) * Register a new PATCH route with the router. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function patch($uri, $action) + public function patch($uri, $action = null) { return $this->addRoute('PATCH', $uri, $action); } @@ -176,10 +169,10 @@ public function patch($uri, $action) * Register a new DELETE route with the router. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function delete($uri, $action) + public function delete($uri, $action = null) { return $this->addRoute('DELETE', $uri, $action); } @@ -188,10 +181,10 @@ public function delete($uri, $action) * Register a new OPTIONS route with the router. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function options($uri, $action) + public function options($uri, $action = null) { return $this->addRoute('OPTIONS', $uri, $action); } @@ -200,10 +193,10 @@ public function options($uri, $action) * Register a new route responding to all verbs. * * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function any($uri, $action) + public function any($uri, $action = null) { $verbs = ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE']; @@ -215,10 +208,10 @@ public function any($uri, $action) * * @param array|string $methods * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ - public function match($methods, $uri, $action) + public function match($methods, $uri, $action = null) { return $this->addRoute(array_map('strtoupper', (array) $methods), $uri, $action); } @@ -228,6 +221,8 @@ public function match($methods, $uri, $action) * * @param array $controllers * @return void + * + * @deprecated since version 5.2. */ public function controllers(array $controllers) { @@ -241,8 +236,10 @@ public function controllers(array $controllers) * * @param string $uri * @param string $controller - * @param array $names + * @param array $names * @return void + * + * @deprecated since version 5.2. */ public function controller($uri, $controller, $names = []) { @@ -276,8 +273,10 @@ public function controller($uri, $controller, $names = []) * @param array $route * @param string $controller * @param string $method - * @param array $names + * @param array $names * @return void + * + * @deprecated since version 5.2. */ protected function registerInspected($route, $controller, $method, &$names) { @@ -297,6 +296,8 @@ protected function registerInspected($route, $controller, $method, &$names) * @param string $controller * @param string $uri * @return void + * + * @deprecated since version 5.2. */ protected function addFallthroughRoute($controller, $uri) { @@ -305,6 +306,27 @@ protected function addFallthroughRoute($controller, $uri) $missing->where('_missing', '(.*)'); } + /** + * Set the unmapped global resource parameters to singular. + * + * @return void + */ + public function singularResourceParameters() + { + ResourceRegistrar::singularParameters(); + } + + /** + * Set the global resource parameter mapping. + * + * @param array $parameters + * @return void + */ + public function resourceParameters(array $parameters = []) + { + ResourceRegistrar::setParameters($parameters); + } + /** * Register an array of resource controllers. * @@ -323,7 +345,7 @@ public function resources(array $resources) * * @param string $name * @param string $controller - * @param array $options + * @param array $options * @return void */ public function resource($name, $controller, array $options = []) @@ -337,10 +359,32 @@ public function resource($name, $controller, array $options = []) $registrar->register($name, $controller, $options); } + /** + * Register the typical authentication routes for an application. + * + * @return void + */ + public function auth() + { + // Authentication Routes... + $this->get('login', 'Auth\AuthController@showLoginForm'); + $this->post('login', 'Auth\AuthController@login'); + $this->get('logout', 'Auth\AuthController@logout'); + + // Registration Routes... + $this->get('register', 'Auth\AuthController@showRegistrationForm'); + $this->post('register', 'Auth\AuthController@register'); + + // Password Reset Routes... + $this->get('password/reset/{token?}', 'Auth\PasswordController@showResetForm'); + $this->post('password/email', 'Auth\PasswordController@sendResetLinkEmail'); + $this->post('password/reset', 'Auth\PasswordController@reset'); + } + /** * Create a route group with shared attributes. * - * @param array $attributes + * @param array $attributes * @param \Closure $callback * @return void */ @@ -468,7 +512,7 @@ public function getLastGroupPrefix() * * @param array|string $methods * @param string $uri - * @param \Closure|array|string $action + * @param \Closure|array|string|null $action * @return \Illuminate\Routing\Route */ protected function addRoute($methods, $uri, $action) @@ -481,7 +525,7 @@ protected function addRoute($methods, $uri, $action) * * @param array|string $methods * @param string $uri - * @param mixed $action + * @param mixed $action * @return \Illuminate\Routing\Route */ protected function createRoute($methods, $uri, $action) @@ -514,12 +558,14 @@ protected function createRoute($methods, $uri, $action) * * @param array|string $methods * @param string $uri - * @param mixed $action + * @param mixed $action * @return \Illuminate\Routing\Route */ protected function newRoute($methods, $uri, $action) { - return (new Route($methods, $uri, $action))->setContainer($this->container); + return (new Route($methods, $uri, $action)) + ->setRouter($this) + ->setContainer($this->container); } /** @@ -573,7 +619,7 @@ protected function actionReferencesController($action) return false; } - return is_string($action) || is_string(isset($action['uses']) ? $action['uses'] : null); + return is_string($action) || (isset($action['uses']) && is_string($action['uses'])); } /** @@ -626,23 +672,9 @@ public function dispatch(Request $request) { $this->currentRequest = $request; - // If no response was returned from the before filter, we will call the proper - // route instance to get the response. If no route is found a response will - // still get returned based on why no routes were found for this request. - $response = $this->callFilter('before', $request); - - if (is_null($response)) { - $response = $this->dispatchToRoute($request); - } - - // Once this route has run and the response has been prepared, we will run the - // after filter to do any last work on the response or for this application - // before we will return the response back to the consuming code for use. - $response = $this->prepareResponse($request, $response); + $response = $this->dispatchToRoute($request); - $this->callFilter('after', $request, $response); - - return $response; + return $this->prepareResponse($request, $response); } /** @@ -662,27 +694,11 @@ public function dispatchToRoute(Request $request) return $route; }); - $this->events->fire('router.matched', [$route, $request]); - - // Once we have successfully matched the incoming request to a given route we - // can call the before filters on that route. This works similar to global - // filters in that if a response is returned we will not call the route. - $response = $this->callRouteBefore($route, $request); - - if (is_null($response)) { - $response = $this->runRouteWithinStack( - $route, $request - ); - } - - $response = $this->prepareResponse($request, $response); + $this->events->fire(new Events\RouteMatched($route, $request)); - // After we have a prepared response from the route or filter we will call to - // the "after" filters to do any last minute processing on this request or - // response object before the response is returned back to the consumer. - $this->callRouteAfter($route, $request, $response); + $response = $this->runRouteWithinStack($route, $request); - return $response; + return $this->prepareResponse($request, $response); } /** @@ -721,22 +737,77 @@ public function gatherRouteMiddlewares(Route $route) return Collection::make($route->middleware())->map(function ($name) { return Collection::make($this->resolveMiddlewareClassName($name)); }) - ->collapse()->all(); + ->flatten()->all(); } /** - * Resolve the middleware name to a class name preserving passed parameters. + * Resolve the middleware name to a class name(s) preserving passed parameters. * * @param string $name - * @return string + * @return string|array */ public function resolveMiddlewareClassName($name) { $map = $this->middleware; - list($name, $parameters) = array_pad(explode(':', $name, 2), 2, null); + // If the middleware is the name of a middleware group, we will return the array + // of middlewares that belong to the group. This allows developers to group a + // set of middleware under single keys that can be conveniently referenced. + if (isset($this->middlewareGroups[$name])) { + return $this->parseMiddlewareGroup($name); + // When the middleware is simply a Closure, we will return this Closure instance + // directly so that Closures can be registered as middleware inline, which is + // convenient on occasions when the developers are experimenting with them. + } elseif (isset($map[$name]) && $map[$name] instanceof Closure) { + return $map[$name]; + // Finally, when the middleware is simply a string mapped to a class name the + // middleware name will get parsed into the full class name and parameters + // which may be run using the Pipeline which accepts this string format. + } else { + list($name, $parameters) = array_pad(explode(':', $name, 2), 2, null); - return (isset($map[$name]) ? $map[$name] : $name).($parameters !== null ? ':'.$parameters : ''); + return (isset($map[$name]) ? $map[$name] : $name). + ($parameters !== null ? ':'.$parameters : ''); + } + } + + /** + * Parse the middleware group and format it for usage. + * + * @param string $name + * @return array + */ + protected function parseMiddlewareGroup($name) + { + $results = []; + + foreach ($this->middlewareGroups[$name] as $middleware) { + // If the middleware is another middleware group we will pull in the group and + // merge its middleware into the results. This allows groups to conveniently + // reference other groups without needing to repeat all their middlewares. + if (isset($this->middlewareGroups[$middleware])) { + $results = array_merge( + $results, $this->parseMiddlewareGroup($middleware) + ); + + continue; + } + + list($middleware, $parameters) = array_pad( + explode(':', $middleware, 2), 2, null + ); + + // If this middleware is actually a route middleware, we will extract the full + // class name out of the middleware list now. Then we'll add the parameters + // back onto this class' name so the pipeline will properly extract them. + if (isset($this->middleware[$middleware])) { + $middleware = $this->middleware[$middleware]; + } + + $results[] = $middleware.($parameters ? ':'.$parameters : ''); + } + + return $results; } /** @@ -768,9 +839,39 @@ protected function substituteBindings($route) } } + $this->substituteImplicitBindings($route); + return $route; } + /** + * Substitute the implicit Eloquent model bindings for the route. + * + * @param \Illuminate\Routing\Route $route + * @return void + */ + protected function substituteImplicitBindings($route) + { + $parameters = $route->parameters(); + + foreach ($route->signatureParameters(Model::class) as $parameter) { + $class = $parameter->getClass(); + + if (array_key_exists($parameter->name, $parameters) && + ! $route->getParameter($parameter->name) instanceof Model) { + $method = $parameter->isDefaultValueAvailable() ? 'first' : 'firstOrFail'; + + $model = $class->newInstance(); + + $route->setParameter( + $parameter->name, $model->where( + $model->getRouteKeyName(), $parameters[$parameter->name] + )->{$method}() + ); + } + } + } + /** * Call the binding callback for the given key. * @@ -792,45 +893,7 @@ protected function performBinding($key, $value, $route) */ public function matched($callback) { - $this->events->listen('router.matched', $callback); - } - - /** - * Register a new "before" filter with the router. - * - * @param string|callable $callback - * @return void - * - * @deprecated since version 5.1. - */ - public function before($callback) - { - $this->addGlobalFilter('before', $callback); - } - - /** - * Register a new "after" filter with the router. - * - * @param string|callable $callback - * @return void - * - * @deprecated since version 5.1. - */ - public function after($callback) - { - $this->addGlobalFilter('after', $callback); - } - - /** - * Register a new global filter with the router. - * - * @param string $filter - * @param string|callable $callback - * @return void - */ - protected function addGlobalFilter($filter, $callback) - { - $this->events->listen('router.'.$filter, $this->parseFilter($callback)); + $this->events->listen(Events\RouteMatched::class, $callback); } /** @@ -858,70 +921,53 @@ public function middleware($name, $class) } /** - * Register a new filter with the router. + * Register a group of middleware. * * @param string $name - * @param string|callable $callback - * @return void - * - * @deprecated since version 5.1. - */ - public function filter($name, $callback) - { - $this->events->listen('router.filter: '.$name, $this->parseFilter($callback)); - } - - /** - * Parse the registered filter. - * - * @param callable|string $callback - * @return mixed + * @param array $middleware + * @return $this */ - protected function parseFilter($callback) + public function middlewareGroup($name, array $middleware) { - if (is_string($callback) && ! Str::contains($callback, '@')) { - return $callback.'@filter'; - } + $this->middlewareGroups[$name] = $middleware; - return $callback; + return $this; } /** - * Register a pattern-based filter with the router. + * Add a middleware to the beginning of a middleware group. * - * @param string $pattern - * @param string $name - * @param array|null $methods - * @return void + * If the middleware is already in the group, it will not be added again. * - * @deprecated since version 5.1. + * @param string $group + * @param string $middleware + * @return $this */ - public function when($pattern, $name, $methods = null) + public function prependMiddlewareToGroup($group, $middleware) { - if (! is_null($methods)) { - $methods = array_map('strtoupper', (array) $methods); + if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) { + array_unshift($this->middlewareGroups[$group], $middleware); } - $this->patternFilters[$pattern][] = compact('name', 'methods'); + return $this; } /** - * Register a regular expression based filter with the router. + * Add a middleware to the end of a middleware group. * - * @param string $pattern - * @param string $name - * @param array|null $methods - * @return void + * If the middleware is already in the group, it will not be added again. * - * @deprecated since version 5.1. + * @param string $group + * @param string $middleware + * @return $this */ - public function whenRegex($pattern, $name, $methods = null) + public function pushMiddlewareToGroup($group, $middleware) { - if (! is_null($methods)) { - $methods = array_map('strtoupper', (array) $methods); + if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) { + $this->middlewareGroups[$group][] = $middleware; } - $this->regexFilters[$pattern][] = compact('name', 'methods'); + return $this; } /** @@ -980,7 +1026,7 @@ public function bind($key, $binder) /** * Create a class based binding using the IoC container. * - * @param string $binding + * @param string $binding * @return \Closure */ public function createClassBinding($binding) @@ -1024,196 +1070,6 @@ public function patterns($patterns) } } - /** - * Call the given filter with the request and response. - * - * @param string $filter - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Http\Response $response - * @return mixed - */ - protected function callFilter($filter, $request, $response = null) - { - return $this->events->until('router.'.$filter, [$request, $response]); - } - - /** - * Call the given route's before filters. - * - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @return mixed - */ - public function callRouteBefore($route, $request) - { - $response = $this->callPatternFilters($route, $request); - - return $response ?: $this->callAttachedBefores($route, $request); - } - - /** - * Call the pattern based filters for the request. - * - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @return mixed - */ - protected function callPatternFilters($route, $request) - { - foreach ($this->findPatternFilters($request) as $filter => $parameters) { - $response = $this->callRouteFilter($filter, $parameters, $route, $request); - - if (! is_null($response)) { - return $response; - } - } - } - - /** - * Find the patterned filters matching a request. - * - * @param \Illuminate\Http\Request $request - * @return array - * - * @deprecated since version 5.1. - */ - public function findPatternFilters($request) - { - $results = []; - - list($path, $method) = [$request->path(), $request->getMethod()]; - - foreach ($this->patternFilters as $pattern => $filters) { - // To find the patterned middlewares for a request, we just need to check these - // registered patterns against the path info for the current request to this - // applications, and when it matches we will merge into these middlewares. - if (Str::is($pattern, $path)) { - $merge = $this->patternsByMethod($method, $filters); - - $results = array_merge($results, $merge); - } - } - - foreach ($this->regexFilters as $pattern => $filters) { - // To find the patterned middlewares for a request, we just need to check these - // registered patterns against the path info for the current request to this - // applications, and when it matches we will merge into these middlewares. - if (preg_match($pattern, $path)) { - $merge = $this->patternsByMethod($method, $filters); - - $results = array_merge($results, $merge); - } - } - - return $results; - } - - /** - * Filter pattern filters that don't apply to the request verb. - * - * @param string $method - * @param array $filters - * @return array - */ - protected function patternsByMethod($method, $filters) - { - $results = []; - - foreach ($filters as $filter) { - // The idea here is to check and see if the pattern filter applies to this HTTP - // request based on the request methods. Pattern filters might be limited by - // the request verb to make it simply to assign to the given verb at once. - if ($this->filterSupportsMethod($filter, $method)) { - $parsed = Route::parseFilters($filter['name']); - - $results = array_merge($results, $parsed); - } - } - - return $results; - } - - /** - * Determine if the given pattern filters applies to a given method. - * - * @param array $filter - * @param array $method - * @return bool - */ - protected function filterSupportsMethod($filter, $method) - { - $methods = $filter['methods']; - - return is_null($methods) || in_array($method, $methods); - } - - /** - * Call the given route's before (non-pattern) filters. - * - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @return mixed - */ - protected function callAttachedBefores($route, $request) - { - foreach ($route->beforeFilters() as $filter => $parameters) { - $response = $this->callRouteFilter($filter, $parameters, $route, $request); - - if (! is_null($response)) { - return $response; - } - } - } - - /** - * Call the given route's after filters. - * - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Http\Response $response - * @return mixed - * - * @deprecated since version 5.1. - */ - public function callRouteAfter($route, $request, $response) - { - foreach ($route->afterFilters() as $filter => $parameters) { - $this->callRouteFilter($filter, $parameters, $route, $request, $response); - } - } - - /** - * Call the given route filter. - * - * @param string $filter - * @param array $parameters - * @param \Illuminate\Routing\Route $route - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Http\Response|null $response - * @return mixed - * - * @deprecated since version 5.1. - */ - public function callRouteFilter($filter, $parameters, $route, $request, $response = null) - { - $data = array_merge([$route, $request, $response], $parameters); - - return $this->events->until('router.filter: '.$filter, $this->cleanFilterParameters($data)); - } - - /** - * Clean the parameters being passed to a filter callback. - * - * @param array $parameters - * @return array - */ - protected function cleanFilterParameters(array $parameters) - { - return array_filter($parameters, function ($p) { - return ! is_null($p) && $p !== ''; - }); - } - /** * Create a response instance from the given value. * @@ -1306,7 +1162,7 @@ public function currentRouteName() } /** - * Alias for the "currentRouteNamed" method. + * Alias for the "currentRouteName" method. * * @param mixed string * @return bool @@ -1406,7 +1262,7 @@ public function getRoutes() public function setRoutes(RouteCollection $routes) { foreach ($routes as $route) { - $route->setContainer($this->container); + $route->setRouter($this)->setContainer($this->container); } $this->routes = $routes; diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php b/application/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php old mode 100644 new mode 100755 index c09c010..104a1f9 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php @@ -8,6 +8,7 @@ use InvalidArgumentException; use Illuminate\Support\Traits\Macroable; use Illuminate\Contracts\Routing\UrlRoutable; +use Illuminate\Routing\Exceptions\UrlGenerationException; use Illuminate\Contracts\Routing\UrlGenerator as UrlGeneratorContract; class UrlGenerator implements UrlGeneratorContract @@ -129,15 +130,22 @@ public function current() /** * Get the URL for the previous request. * + * @param mixed $fallback * @return string */ - public function previous() + public function previous($fallback = false) { $referrer = $this->request->headers->get('referer'); $url = $referrer ? $this->to($referrer) : $this->getPreviousUrlFromSession(); - return $url ?: $this->to('/'); + if ($url) { + return $url; + } elseif ($fallback) { + return $this->to($fallback); + } else { + return $this->to('/'); + } } /** @@ -171,8 +179,8 @@ public function to($path, $extra = [], $secure = null) $root = $this->getRootUrl($scheme); if (($queryPosition = strpos($path, '?')) !== false) { - $query = substr($path, $queryPosition); - $path = substr($path, 0, $queryPosition); + $query = mb_substr($path, $queryPosition); + $path = mb_substr($path, 0, $queryPosition); } else { $query = ''; } @@ -313,6 +321,8 @@ public function route($name, $parameters = [], $absolute = true) * @param mixed $parameters * @param bool $absolute * @return string + * + * @throws \Illuminate\Routing\Exceptions\UrlGenerationException */ protected function toRoute($route, $parameters, $absolute) { @@ -320,10 +330,16 @@ protected function toRoute($route, $parameters, $absolute) $domain = $this->getRouteDomain($route, $parameters); - $uri = strtr(rawurlencode($this->addQueryString($this->trimUrl( + $uri = $this->addQueryString($this->trimUrl( $root = $this->replaceRoot($route, $domain, $parameters), $this->replaceRouteParameters($route->uri(), $parameters) - ), $parameters)), $this->dontEncode); + ), $parameters); + + if (preg_match('/\{.*?\}/', $uri)) { + throw UrlGenerationException::forMissingParameters($route); + } + + $uri = strtr(rawurlencode($uri), $this->dontEncode); return $absolute ? $uri : '/'.ltrim(str_replace($root, '', $uri), '/'); } @@ -338,7 +354,9 @@ protected function toRoute($route, $parameters, $absolute) */ protected function replaceRoot($route, $domain, &$parameters) { - return $this->replaceRouteParameters($this->getRouteRoot($route, $domain), $parameters); + return $this->replaceRouteParameters( + $this->getRouteRoot($route, $domain), $parameters + ); } /** @@ -350,11 +368,13 @@ protected function replaceRoot($route, $domain, &$parameters) */ protected function replaceRouteParameters($path, array &$parameters) { - if (count($parameters)) { - $path = preg_replace_sub( - '/\{.*?\}/', $parameters, $this->replaceNamedParameters($path, $parameters) - ); - } + $path = $this->replaceNamedParameters($path, $parameters); + + $path = preg_replace_callback('/\{.*?\}/', function ($match) use (&$parameters) { + return (empty($parameters) && ! Str::endsWith($match[0], '?}')) + ? $match[0] + : array_shift($parameters); + }, $path); return trim(preg_replace('/\{.*?\?\}/', '', $path), '/'); } @@ -382,7 +402,7 @@ protected function replaceNamedParameters($path, &$parameters) */ protected function addQueryString($uri, array $parameters) { - // If the URI has a fragment, we will move it to the end of the URI since it will + // If the URI has a fragment, we will move it to the end of this URI since it will // need to come after any query string that may be added to the URL else it is // not going to be available. We will remove it then append it back on here. if (! is_null($fragment = parse_url($uri, PHP_URL_FRAGMENT))) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Routing/composer.json b/application/vendor/laravel/framework/src/Illuminate/Routing/composer.json index af0a63b..126e114 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Routing/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Routing/composer.json @@ -10,20 +10,21 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/container": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/http": "5.1.*", - "illuminate/pipeline": "5.1.*", - "illuminate/session": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/http-foundation": "2.7.*", - "symfony/http-kernel": "2.7.*", - "symfony/routing": "2.7.*" + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/http": "5.2.*", + "illuminate/pipeline": "5.2.*", + "illuminate/session": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/debug": "2.8.*|3.0.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/http-kernel": "2.8.*|3.0.*", + "symfony/routing": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -32,11 +33,11 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { - "illuminate/console": "Required to use the make commands (5.1.*).", + "illuminate/console": "Required to use the make commands (5.2.*).", "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php b/application/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/CommandsServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Session/CommandsServiceProvider.php deleted file mode 100644 index 9514c4f..0000000 --- a/application/vendor/laravel/framework/src/Illuminate/Session/CommandsServiceProvider.php +++ /dev/null @@ -1,40 +0,0 @@ -app->singleton('command.session.database', function ($app) { - return new SessionTableCommand($app['files'], $app['composer']); - }); - - $this->commands('command.session.database'); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['command.session.database']; - } -} diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php b/application/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php index 2290d3c..d8f2903 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php +++ b/application/vendor/laravel/framework/src/Illuminate/Session/Console/SessionTableCommand.php @@ -3,7 +3,7 @@ namespace Illuminate\Session\Console; use Illuminate\Console\Command; -use Illuminate\Foundation\Composer; +use Illuminate\Support\Composer; use Illuminate\Filesystem\Filesystem; class SessionTableCommand extends Command @@ -30,7 +30,7 @@ class SessionTableCommand extends Command protected $files; /** - * @var \Illuminate\Foundation\Composer + * @var \Illuminate\Support\Composer */ protected $composer; @@ -38,7 +38,7 @@ class SessionTableCommand extends Command * Create a new session table command instance. * * @param \Illuminate\Filesystem\Filesystem $files - * @param \Illuminate\Foundation\Composer $composer + * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(Filesystem $files, Composer $composer) diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub b/application/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub old mode 100644 new mode 100755 index 0529755..f1c84aa --- a/application/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub +++ b/application/vendor/laravel/framework/src/Illuminate/Session/Console/stubs/database.stub @@ -14,6 +14,9 @@ class CreateSessionsTable extends Migration { Schema::create('sessions', function (Blueprint $table) { $table->string('id')->unique(); + $table->integer('user_id')->nullable(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); $table->text('payload'); $table->integer('last_activity'); }); diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php b/application/vendor/laravel/framework/src/Illuminate/Session/CookieSessionHandler.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php b/application/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php index d08d1a1..3768cc0 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php +++ b/application/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php @@ -4,8 +4,9 @@ use Carbon\Carbon; use SessionHandlerInterface; -use Illuminate\Database\QueryException; +use Illuminate\Contracts\Auth\Guard; use Illuminate\Database\ConnectionInterface; +use Illuminate\Contracts\Container\Container; class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareInterface { @@ -23,13 +24,20 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI */ protected $table; - /** + /* * The number of minutes the session should be valid. * * @var int */ protected $minutes; + /** + * The container instance. + * + * @var \Illuminate\Contracts\Container\Container + */ + protected $container; + /** * The existence state of the session. * @@ -42,13 +50,15 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI * * @param \Illuminate\Database\ConnectionInterface $connection * @param string $table - * @param int $minutes + * @param string $minutes + * @param \Illuminate\Contracts\Container\Container|null $container * @return void */ - public function __construct(ConnectionInterface $connection, $table, $minutes) + public function __construct(ConnectionInterface $connection, $table, $minutes, Container $container = null) { $this->table = $table; $this->minutes = $minutes; + $this->container = $container; $this->connection = $connection; } @@ -95,45 +105,50 @@ public function read($sessionId) */ public function write($sessionId, $data) { + $payload = $this->getDefaultPayload($data); + + if (! $this->exists) { + $this->read($sessionId); + } + if ($this->exists) { - $this->performUpdate($sessionId, $data); + $this->getQuery()->where('id', $sessionId)->update($payload); } else { - $this->performInsert($sessionId, $data); + $payload['id'] = $sessionId; + + $this->getQuery()->insert($payload); } $this->exists = true; } /** - * Perform an insert operation on the session ID. + * Get the default payload for the session. * - * @param string $sessionId * @param string $data - * @return void + * @return array */ - protected function performInsert($sessionId, $data) + protected function getDefaultPayload($data) { - try { - return $this->getQuery()->insert([ - 'id' => $sessionId, 'payload' => base64_encode($data), 'last_activity' => time(), - ]); - } catch (QueryException $e) { - $this->performUpdate($sessionId, $data); + $payload = ['payload' => base64_encode($data), 'last_activity' => time()]; + + if (! $container = $this->container) { + return $payload; } - } - /** - * Perform an update operation on the session ID. - * - * @param string $sessionId - * @param string $data - * @return int - */ - protected function performUpdate($sessionId, $data) - { - return $this->getQuery()->where('id', $sessionId)->update([ - 'payload' => base64_encode($data), 'last_activity' => time(), - ]); + if ($container->bound(Guard::class)) { + $payload['user_id'] = $container->make(Guard::class)->id(); + } + + if ($container->bound('request')) { + $payload['ip_address'] = $container->make('request')->ip(); + + $payload['user_agent'] = substr( + (string) $container->make('request')->header('User-Agent'), 0, 500 + ); + } + + return $payload; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/LegacyDatabaseSessionHandler.php b/application/vendor/laravel/framework/src/Illuminate/Session/LegacyDatabaseSessionHandler.php new file mode 100644 index 0000000..f776666 --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Session/LegacyDatabaseSessionHandler.php @@ -0,0 +1,151 @@ +table = $table; + $this->minutes = $minutes; + $this->connection = $connection; + } + + /** + * {@inheritdoc} + */ + public function open($savePath, $sessionName) + { + return true; + } + + /** + * {@inheritdoc} + */ + public function close() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function read($sessionId) + { + $session = (object) $this->getQuery()->find($sessionId); + + if (isset($session->last_activity)) { + if ($session->last_activity < Carbon::now()->subMinutes($this->minutes)->getTimestamp()) { + $this->exists = true; + + return; + } + } + + if (isset($session->payload)) { + $this->exists = true; + + return base64_decode($session->payload); + } + } + + /** + * {@inheritdoc} + */ + public function write($sessionId, $data) + { + if ($this->exists) { + $this->getQuery()->where('id', $sessionId)->update([ + 'payload' => base64_encode($data), 'last_activity' => time(), + ]); + } else { + $this->getQuery()->insert([ + 'id' => $sessionId, 'payload' => base64_encode($data), 'last_activity' => time(), + ]); + } + + $this->exists = true; + } + + /** + * {@inheritdoc} + */ + public function destroy($sessionId) + { + $this->getQuery()->where('id', $sessionId)->delete(); + } + + /** + * {@inheritdoc} + */ + public function gc($lifetime) + { + $this->getQuery()->where('last_activity', '<=', time() - $lifetime)->delete(); + } + + /** + * Get a fresh query builder instance for the table. + * + * @return \Illuminate\Database\Query\Builder + */ + protected function getQuery() + { + return $this->connection->table($this->table); + } + + /** + * Set the existence state for the session. + * + * @param bool $value + * @return $this + */ + public function setExists($value) + { + $this->exists = $value; + + return $this; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php b/application/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php index 5372024..2233233 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php +++ b/application/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php @@ -8,8 +8,8 @@ use Illuminate\Http\Request; use Illuminate\Session\SessionManager; use Illuminate\Session\SessionInterface; -use Illuminate\Session\CookieSessionHandler; use Symfony\Component\HttpFoundation\Cookie; +use Illuminate\Session\CookieSessionHandler; use Symfony\Component\HttpFoundation\Response; class StartSession @@ -57,6 +57,8 @@ public function handle($request, Closure $next) $session = $this->startSession($request); $request->setSession($session); + + $this->collectGarbage($session); } $response = $next($request); @@ -67,8 +69,6 @@ public function handle($request, Closure $next) if ($this->sessionConfigured()) { $this->storeCurrentUrl($request, $session); - $this->collectGarbage($session); - $this->addCookieToResponse($response, $session); } @@ -97,7 +97,9 @@ public function terminate($request, $response) */ protected function startSession(Request $request) { - with($session = $this->getSession($request))->setRequestOnHandler($request); + $session = $this->getSession($request); + + $session->setRequestOnHandler($request); $session->start(); @@ -159,7 +161,7 @@ protected function collectGarbage(SessionInterface $session) */ protected function configHitsLottery(array $config) { - return mt_rand(1, $config['lottery'][1]) <= $config['lottery'][0]; + return random_int(1, $config['lottery'][1]) <= $config['lottery'][0]; } /** @@ -178,7 +180,8 @@ protected function addCookieToResponse(Response $response, SessionInterface $ses if ($this->sessionIsPersistent($config = $this->manager->getSessionConfig())) { $response->headers->setCookie(new Cookie( $session->getName(), $session->getId(), $this->getCookieExpirationDate(), - $config['path'], $config['domain'], Arr::get($config, 'secure', false) + $config['path'], $config['domain'], Arr::get($config, 'secure', false), + Arr::get($config, 'http_only', true) )); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php b/application/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php old mode 100644 new mode 100755 index d87b8ed..a05d75d --- a/application/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Session/SessionManager.php @@ -77,7 +77,25 @@ protected function createDatabaseDriver() $lifetime = $this->app['config']['session.lifetime']; - return $this->buildSession(new DatabaseSessionHandler($connection, $table, $lifetime)); + return $this->buildSession(new DatabaseSessionHandler($connection, $table, $lifetime, $this->app)); + } + + /** + * Create an instance of the legacy database session driver. + * + * @return \Illuminate\Session\Store + * + * @deprecated since version 5.2. + */ + protected function createLegacyDatabaseDriver() + { + $connection = $this->getDatabaseConnection(); + + $table = $this->app['config']['session.table']; + + $lifetime = $this->app['config']['session.lifetime']; + + return $this->buildSession(new LegacyDatabaseSessionHandler($connection, $table, $lifetime)); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Session/SessionServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/Store.php b/application/vendor/laravel/framework/src/Illuminate/Session/Store.php old mode 100644 new mode 100755 index 3419713..1808bc6 --- a/application/vendor/laravel/framework/src/Illuminate/Session/Store.php +++ b/application/vendor/laravel/framework/src/Illuminate/Session/Store.php @@ -310,7 +310,15 @@ public function ageFlashData() */ public function has($name) { - return ! is_null($this->get($name)); + $keys = is_array($name) ? $name : func_get_args(); + + foreach ($keys as $value) { + if (is_null($this->get($value))) { + return false; + } + } + + return true; } /** @@ -405,6 +413,34 @@ public function push($key, $value) $this->put($key, $array); } + /** + * Increment the value of an item in the session. + * + * @param string $key + * @param int $amount + * @return mixed + */ + public function increment($key, $amount = 1) + { + $value = $this->get($key, 0) + $amount; + + $this->put($key, $value); + + return $value; + } + + /** + * Decrement the value of an item in the session. + * + * @param string $key + * @param int $amount + * @return int + */ + public function decrement($key, $amount = 1) + { + return $this->increment($key, $amount * -1); + } + /** * Flash a key / value pair to the session. * diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php b/application/vendor/laravel/framework/src/Illuminate/Session/TokenMismatchException.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Session/composer.json b/application/vendor/laravel/framework/src/Illuminate/Session/composer.json old mode 100644 new mode 100755 index 6112ed7..b8f8650 --- a/application/vendor/laravel/framework/src/Illuminate/Session/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Session/composer.json @@ -10,16 +10,16 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "nesbot/carbon": "~1.19", - "symfony/finder": "2.7.*", - "symfony/http-foundation": "2.7.*" + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "nesbot/carbon": "~1.20", + "symfony/finder": "2.8.*|3.0.*", + "symfony/http-foundation": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -28,11 +28,11 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { - "illuminate/console": "Required to use the session:table command (5.1.*)." + "illuminate/console": "Required to use the session:table command (5.2.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/Arr.php b/application/vendor/laravel/framework/src/Illuminate/Support/Arr.php old mode 100644 new mode 100755 index 93e9569..13aa891 --- a/application/vendor/laravel/framework/src/Illuminate/Support/Arr.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Arr.php @@ -2,12 +2,24 @@ namespace Illuminate\Support; +use ArrayAccess; use Illuminate\Support\Traits\Macroable; class Arr { use Macroable; + /** + * Determine whether the given value is array accessible. + * + * @param mixed $value + * @return bool + */ + public static function accessible($value) + { + return is_array($value) || $value instanceof ArrayAccess; + } + /** * Add an element to an array using "dot" notation if it doesn't exist. * @@ -31,6 +43,8 @@ public static function add($array, $key, $value) * @param array $array * @param callable $callback * @return array + * + * @deprecated since version 5.2. */ public static function build($array, callable $callback) { @@ -48,7 +62,7 @@ public static function build($array, callable $callback) /** * Collapse an array of arrays into a single array. * - * @param \ArrayAccess|array $array + * @param array $array * @return array */ public static function collapse($array) @@ -58,6 +72,8 @@ public static function collapse($array) foreach ($array as $values) { if ($values instanceof Collection) { $values = $values->all(); + } elseif (! is_array($values)) { + continue; } $results = array_merge($results, $values); @@ -89,7 +105,7 @@ public static function dot($array, $prepend = '') $results = []; foreach ($array as $key => $value) { - if (is_array($value)) { + if (is_array($value) && ! empty($value)) { $results = array_merge($results, static::dot($value, $prepend.$key.'.')); } else { $results[$prepend.$key] = $value; @@ -114,41 +130,35 @@ public static function except($array, $keys) } /** - * Fetch a flattened array of a nested array element. - * - * @param array $array - * @param string $key - * @return array + * Determine if the given key exists in the provided array. * - * @deprecated since version 5.1. Use pluck instead. + * @param \ArrayAccess|array $array + * @param string|int $key + * @return bool */ - public static function fetch($array, $key) + public static function exists($array, $key) { - foreach (explode('.', $key) as $segment) { - $results = []; - - foreach ($array as $value) { - if (array_key_exists($segment, $value = (array) $value)) { - $results[] = $value[$segment]; - } - } - - $array = array_values($results); + if ($array instanceof ArrayAccess) { + return $array->offsetExists($key); } - return array_values($results); + return array_key_exists($key, $array); } /** * Return the first element in an array passing a given truth test. * * @param array $array - * @param callable $callback + * @param callable|null $callback * @param mixed $default * @return mixed */ - public static function first($array, callable $callback, $default = null) + public static function first($array, callable $callback = null, $default = null) { + if (is_null($callback)) { + return empty($array) ? value($default) : reset($array); + } + foreach ($array as $key => $value) { if (call_user_func($callback, $key, $value)) { return $value; @@ -162,12 +172,16 @@ public static function first($array, callable $callback, $default = null) * Return the last element in an array passing a given truth test. * * @param array $array - * @param callable $callback + * @param callable|null $callback * @param mixed $default * @return mixed */ - public static function last($array, callable $callback, $default = null) + public static function last($array, callable $callback = null, $default = null) { + if (is_null($callback)) { + return empty($array) ? value($default) : end($array); + } + return static::first(array_reverse($array), $callback, $default); } @@ -175,17 +189,30 @@ public static function last($array, callable $callback, $default = null) * Flatten a multi-dimensional array into a single level. * * @param array $array + * @param int $depth * @return array */ - public static function flatten($array) + public static function flatten($array, $depth = INF) { - $return = []; + $result = []; - array_walk_recursive($array, function ($x) use (&$return) { - $return[] = $x; - }); + foreach ($array as $item) { + $item = $item instanceof Collection ? $item->all() : $item; - return $return; + if (is_array($item)) { + if ($depth === 1) { + $result = array_merge($result, $item); + continue; + } + + $result = array_merge($result, static::flatten($item, $depth - 1)); + continue; + } + + $result[] = $item; + } + + return $result; } /** @@ -206,49 +233,60 @@ public static function forget(&$array, $keys) } foreach ($keys as $key) { + // if the exact key exists in the top-level, remove it + if (static::exists($array, $key)) { + unset($array[$key]); + + continue; + } + $parts = explode('.', $key); + // clean up before each pass + $array = &$original; + while (count($parts) > 1) { $part = array_shift($parts); if (isset($array[$part]) && is_array($array[$part])) { $array = &$array[$part]; } else { - $parts = []; + continue 2; } } unset($array[array_shift($parts)]); - - // clean up after each pass - $array = &$original; } } /** * Get an item from an array using "dot" notation. * - * @param array $array + * @param \ArrayAccess|array $array * @param string $key * @param mixed $default * @return mixed */ public static function get($array, $key, $default = null) { + if (! static::accessible($array)) { + return value($default); + } + if (is_null($key)) { return $array; } - if (isset($array[$key])) { + if (static::exists($array, $key)) { return $array[$key]; } foreach (explode('.', $key) as $segment) { - if (! is_array($array) || ! array_key_exists($segment, $array)) { + if (static::accessible($array) && static::exists($array, $segment)) { + $array = $array[$segment]; + } else { return value($default); } - - $array = $array[$segment]; } return $array; @@ -257,26 +295,30 @@ public static function get($array, $key, $default = null) /** * Check if an item exists in an array using "dot" notation. * - * @param array $array + * @param \ArrayAccess|array $array * @param string $key * @return bool */ public static function has($array, $key) { - if (empty($array) || is_null($key)) { + if (! $array) { + return false; + } + + if (is_null($key)) { return false; } - if (array_key_exists($key, $array)) { + if (static::exists($array, $key)) { return true; } foreach (explode('.', $key) as $segment) { - if (! is_array($array) || ! array_key_exists($segment, $array)) { + if (static::accessible($array) && static::exists($array, $segment)) { + $array = $array[$segment]; + } else { return false; } - - $array = $array[$segment]; } return true; @@ -312,7 +354,7 @@ public static function only($array, $keys) /** * Pluck an array of values from an array. * - * @param array $array + * @param array $array * @param string|array $value * @param string|array|null $key * @return array diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/Collection.php b/application/vendor/laravel/framework/src/Illuminate/Support/Collection.php index d585bec..5ce9484 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Support/Collection.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Collection.php @@ -4,6 +4,7 @@ use Countable; use ArrayAccess; +use Traversable; use ArrayIterator; use CachingIterator; use JsonSerializable; @@ -32,7 +33,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate */ public function __construct($items = []) { - $this->items = is_array($items) ? $items : $this->getArrayableItems($items); + $this->items = $this->getArrayableItems($items); } /** @@ -80,6 +81,65 @@ public function average($key = null) return $this->avg($key); } + /** + * Get the median of a given key. + * + * @param null $key + * @return mixed|null + */ + public function median($key = null) + { + $count = $this->count(); + + if ($count == 0) { + return; + } + + $values = with(isset($key) ? $this->pluck($key) : $this) + ->sort()->values(); + + $middle = (int) floor($count / 2); + + if ($count % 2) { + return $values->get($middle); + } + + return (new static([ + $values->get($middle - 1), $values->get($middle), + ]))->average(); + } + + /** + * Get the mode of a given key. + * + * @param null $key + * @return array + */ + public function mode($key = null) + { + $count = $this->count(); + + if ($count == 0) { + return; + } + + $collection = isset($key) ? $this->pluck($key) : $this; + + $counts = new self; + + $collection->each(function ($value) use ($counts) { + $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1; + }); + + $sorted = $counts->sort(); + + $highestValue = $sorted->last(); + + return $sorted->filter(function ($value) use ($highestValue) { + return $value == $highestValue; + })->sort()->keys()->all(); + } + /** * Collapse the collection of items into a single array. * @@ -123,6 +183,17 @@ public function diff($items) return new static(array_diff($this->items, $this->getArrayableItems($items))); } + /** + * Get the items in the collection whose keys are not present in the given items. + * + * @param mixed $items + * @return static + */ + public function diffKeys($items) + { + return new static(array_diff_key($this->items, $this->getArrayableItems($items))); + } + /** * Execute a callback over each item. * @@ -153,7 +224,7 @@ public function every($step, $offset = 0) $position = 0; - foreach ($this->items as $key => $item) { + foreach ($this->items as $item) { if ($position % $step === $offset) { $new[] = $item; } @@ -177,19 +248,6 @@ public function except($keys) return new static(Arr::except($this->items, $keys)); } - /** - * Fetch a nested element of the collection. - * - * @param string $key - * @return static - * - * @deprecated since version 5.1. Use pluck instead. - */ - public function fetch($key) - { - return new static(Arr::fetch($this->items, $key)); - } - /** * Run a filter over each of the items. * @@ -199,7 +257,15 @@ public function fetch($key) public function filter(callable $callback = null) { if ($callback) { - return new static(array_filter($this->items, $callback)); + $return = []; + + foreach ($this->items as $key => $value) { + if ($callback($value, $key)) { + $return[$key] = $value; + } + } + + return new static($return); } return new static(array_filter($this->items)); @@ -233,6 +299,33 @@ public function whereLoose($key, $value) return $this->where($key, $value, false); } + /** + * Filter items by the given key value pair. + * + * @param string $key + * @param array $values + * @param bool $strict + * @return static + */ + public function whereIn($key, array $values, $strict = true) + { + return $this->filter(function ($item) use ($key, $values, $strict) { + return in_array(data_get($item, $key), $values, $strict); + }); + } + + /** + * Filter items by the given key value pair using loose comparison. + * + * @param string $key + * @param array $values + * @return static + */ + public function whereInLoose($key, array $values) + { + return $this->whereIn($key, $values, false); + } + /** * Get the first item from the collection. * @@ -242,21 +335,18 @@ public function whereLoose($key, $value) */ public function first(callable $callback = null, $default = null) { - if (is_null($callback)) { - return count($this->items) > 0 ? reset($this->items) : value($default); - } - return Arr::first($this->items, $callback, $default); } /** * Get a flattened array of the items in the collection. * + * @param int $depth * @return static */ - public function flatten() + public function flatten($depth = INF) { - return new static(Arr::flatten($this->items)); + return new static(Arr::flatten($this->items, $depth)); } /** @@ -304,7 +394,7 @@ public function get($key, $default = null) * Group an associative array by a field or using a callback. * * @param callable|string $groupBy - * @param bool $preserveKeys + * @param bool $preserveKeys * @return static */ public function groupBy($groupBy, $preserveKeys = false) @@ -314,13 +404,19 @@ public function groupBy($groupBy, $preserveKeys = false) $results = []; foreach ($this->items as $key => $value) { - $groupKey = $groupBy($value, $key); + $groupKeys = $groupBy($value, $key); - if (! array_key_exists($groupKey, $results)) { - $results[$groupKey] = new static; + if (! is_array($groupKeys)) { + $groupKeys = [$groupKeys]; } - $results[$groupKey]->offsetSet($preserveKeys ? $key : null, $value); + foreach ($groupKeys as $groupKey) { + if (! array_key_exists($groupKey, $results)) { + $results[$groupKey] = new static; + } + + $results[$groupKey]->offsetSet($preserveKeys ? $key : null, $value); + } } return new static($results); @@ -338,8 +434,8 @@ public function keyBy($keyBy) $results = []; - foreach ($this->items as $item) { - $results[$keyBy($item)] = $item; + foreach ($this->items as $key => $item) { + $results[$keyBy($item, $key)] = $item; } return new static($results); @@ -425,10 +521,6 @@ public function keys() */ public function last(callable $callback = null, $default = null) { - if (is_null($callback)) { - return count($this->items) > 0 ? end($this->items) : value($default); - } - return Arr::last($this->items, $callback, $default); } @@ -450,6 +542,8 @@ public function pluck($value, $key = null) * @param string $value * @param string|null $key * @return static + * + * @deprecated since version 5.2. Use the "pluck" method directly. */ public function lists($value, $key = null) { @@ -508,6 +602,28 @@ public function merge($items) return new static(array_merge($this->items, $this->getArrayableItems($items))); } + /** + * Create a collection by using this collection for keys and another for its values. + * + * @param mixed $values + * @return static + */ + public function combine($values) + { + return new static(array_combine($this->all(), $this->getArrayableItems($values))); + } + + /** + * Union the collection with the given items. + * + * @param mixed $items + * @return static + */ + public function union($items) + { + return new static($this->items + $this->getArrayableItems($items)); + } + /** * Get the min value of a given key. * @@ -548,6 +664,17 @@ public function forPage($page, $perPage) return $this->slice(($page - 1) * $perPage, $perPage); } + /** + * Pass the collection to the given callback and return the result. + * + * @param callable $callback + * @return mixed + */ + public function pipe(callable $callback) + { + return $callback($this); + } + /** * Get and remove the last item from the collection. * @@ -655,8 +782,8 @@ public function reduce(callable $callback, $initial = null) public function reject($callback) { if ($this->useAsCallable($callback)) { - return $this->filter(function ($item) use ($callback) { - return ! $callback($item); + return $this->filter(function ($value, $key) use ($callback) { + return ! $callback($value, $key); }); } @@ -672,7 +799,7 @@ public function reject($callback) */ public function reverse() { - return new static(array_reverse($this->items)); + return new static(array_reverse($this->items, true)); } /** @@ -710,13 +837,22 @@ public function shift() /** * Shuffle the items in the collection. * + * @param int $seed * @return static */ - public function shuffle() + public function shuffle($seed = null) { $items = $this->items; - shuffle($items); + if (is_null($seed)) { + shuffle($items); + } else { + srand($seed); + + usort($items, function () { + return rand(-1, 1); + }); + } return new static($items); } @@ -726,26 +862,24 @@ public function shuffle() * * @param int $offset * @param int $length - * @param bool $preserveKeys * @return static */ - public function slice($offset, $length = null, $preserveKeys = false) + public function slice($offset, $length = null) { - return new static(array_slice($this->items, $offset, $length, $preserveKeys)); + return new static(array_slice($this->items, $offset, $length, true)); } /** * Chunk the underlying collection array. * * @param int $size - * @param bool $preserveKeys * @return static */ - public function chunk($size, $preserveKeys = false) + public function chunk($size) { $chunks = []; - foreach (array_chunk($this->items, $size, $preserveKeys) as $chunk) { + foreach (array_chunk($this->items, $size, true) as $chunk) { $chunks[] = new static($chunk); } @@ -976,7 +1110,17 @@ public function toArray() */ public function jsonSerialize() { - return $this->toArray(); + return array_map(function ($value) { + if ($value instanceof JsonSerializable) { + return $value->jsonSerialize(); + } elseif ($value instanceof Jsonable) { + return json_decode($value->toJson(), true); + } elseif ($value instanceof Arrayable) { + return $value->toArray(); + } else { + return $value; + } + }, $this->items); } /** @@ -987,7 +1131,7 @@ public function jsonSerialize() */ public function toJson($options = 0) { - return json_encode($this->toArray(), $options); + return json_encode($this->jsonSerialize(), $options); } /** @@ -1088,12 +1232,18 @@ public function __toString() */ protected function getArrayableItems($items) { - if ($items instanceof self) { + if (is_array($items)) { + return $items; + } elseif ($items instanceof self) { return $items->all(); } elseif ($items instanceof Arrayable) { return $items->toArray(); } elseif ($items instanceof Jsonable) { return json_decode($items->toJson(), true); + } elseif ($items instanceof JsonSerializable) { + return $items->jsonSerialize(); + } elseif ($items instanceof Traversable) { + return iterator_to_array($items); } return (array) $items; diff --git a/application/vendor/laravel/framework/src/Illuminate/Foundation/Composer.php b/application/vendor/laravel/framework/src/Illuminate/Support/Composer.php similarity index 96% rename from application/vendor/laravel/framework/src/Illuminate/Foundation/Composer.php rename to application/vendor/laravel/framework/src/Illuminate/Support/Composer.php index 1027394..50bed39 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Foundation/Composer.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Composer.php @@ -1,6 +1,6 @@ toArray(), $options); + return json_encode($this->jsonSerialize(), $options); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/Manager.php b/application/vendor/laravel/framework/src/Illuminate/Support/Manager.php old mode 100644 new mode 100755 index 29154c6..ce484f0 --- a/application/vendor/laravel/framework/src/Illuminate/Support/Manager.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Manager.php @@ -76,7 +76,7 @@ public function driver($driver = null) */ protected function createDriver($driver) { - $method = 'create'.ucfirst($driver).'Driver'; + $method = 'create'.Str::studly($driver).'Driver'; // We'll check to see if a creator method exists for the given driver. If not we // will check for a custom driver creator, which allows developers to create diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php b/application/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php old mode 100644 new mode 100755 index a58b154..575b8d1 --- a/application/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/MessageBag.php @@ -96,14 +96,43 @@ protected function isUnique($key, $message) } /** - * Determine if messages exist for a given key. + * Determine if messages exist for all of the given keys. * - * @param string $key + * @param array|string $key * @return bool */ public function has($key = null) { - return $this->first($key) !== ''; + if (is_null($key)) { + return $this->any(); + } + + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $key) { + if ($this->first($key) === '') { + return false; + } + } + + return true; + } + + /** + * Determine if messages exist for any of the given keys. + * + * @param array $keys + * @return bool + */ + public function hasAny($keys = []) + { + foreach ($keys as $key) { + if ($this->has($key)) { + return true; + } + } + + return false; } /** @@ -158,6 +187,17 @@ public function all($format = null) return $all; } + /** + * Get all of the unique messages for every key in the bag. + * + * @param string $format + * @return array + */ + public function unique($format = null) + { + return array_unique($this->all($format)); + } + /** * Format an array of messages. * @@ -198,11 +238,21 @@ protected function checkFormat($format) * * @return array */ - public function getMessages() + public function messages() { return $this->messages; } + /** + * Get the raw messages in the container. + * + * @return array + */ + public function getMessages() + { + return $this->messages(); + } + /** * Get the messages for the instance. * @@ -294,7 +344,7 @@ public function jsonSerialize() */ public function toJson($options = 0) { - return json_encode($this->toArray(), $options); + return json_encode($this->jsonSerialize(), $options); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php b/application/vendor/laravel/framework/src/Illuminate/Support/NamespacedItemResolver.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php b/application/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php old mode 100644 new mode 100755 index 7ba7a4d..8712572 --- a/application/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php @@ -29,8 +29,10 @@ class Pluralizer 'rain', 'money', 'moose', + 'nutrition', 'offspring', 'plankton', + 'pokemon', 'police', 'rice', 'series', @@ -49,7 +51,7 @@ class Pluralizer */ public static function plural($value, $count = 2) { - if ($count === 1 || static::uncountable($value)) { + if ((int) $count === 1 || static::uncountable($value)) { return $value; } diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php old mode 100644 new mode 100755 index a845188..4944597 --- a/application/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php @@ -3,6 +3,7 @@ namespace Illuminate\Support; use BadMethodCallException; +use Illuminate\Console\Events\ArtisanStarting; abstract class ServiceProvider { @@ -103,7 +104,7 @@ protected function loadTranslationsFrom($path, $namespace) */ protected function publishes(array $paths, $group = null) { - $class = get_class($this); + $class = static::class; if (! array_key_exists($class, static::$publishes)) { static::$publishes[$class] = []; @@ -134,7 +135,7 @@ public static function pathsToPublish($provider = null, $group = null) return []; } - return array_intersect(static::$publishes[$provider], static::$publishGroups[$group]); + return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); } if ($group && array_key_exists($group, static::$publishGroups)) { @@ -173,8 +174,8 @@ public function commands($commands) // give us the Artisan console instance which we will give commands to. $events = $this->app['events']; - $events->listen('artisan.start', function ($artisan) use ($commands) { - $artisan->resolveCommands($commands); + $events->listen(ArtisanStarting::class, function ($event) use ($commands) { + $event->artisan->resolveCommands($commands); }); } @@ -224,6 +225,8 @@ public static function compiles() * @param string $method * @param array $parameters * @return mixed + * + * @throws \BadMethodCallException */ public function __call($method, $parameters) { diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/Str.php b/application/vendor/laravel/framework/src/Illuminate/Support/Str.php index 2c3a7cb..fe9eff0 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Support/Str.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Str.php @@ -2,7 +2,6 @@ namespace Illuminate\Support; -use Stringy\StaticStringy; use Illuminate\Support\Traits\Macroable; class Str @@ -38,7 +37,11 @@ class Str */ public static function ascii($value) { - return StaticStringy::toAscii($value); + foreach (static::charsArray() as $key => $val) { + $value = str_replace($val, $key, $value); + } + + return preg_replace('/[^\x20-\x7E]/u', '', $value); } /** @@ -124,9 +127,9 @@ public static function is($pattern, $value) // Asterisks are translated into zero-or-more regular expression wildcards // to make it convenient to check if the strings starts with the given // pattern such as "library/*", making any string check convenient. - $pattern = str_replace('\*', '.*', $pattern).'\z'; + $pattern = str_replace('\*', '.*', $pattern); - return (bool) preg_match('#^'.$pattern.'#u', $value); + return (bool) preg_match('#^'.$pattern.'\z#u', $value); } /** @@ -221,12 +224,12 @@ public static function random($length = 16) { $string = ''; - while (($len = strlen($string)) < $length) { + while (($len = static::length($string)) < $length) { $size = $length - $len; - $bytes = static::randomBytes($size); + $bytes = random_bytes($size); - $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); + $string .= static::substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); } return $string; @@ -237,6 +240,8 @@ public static function random($length = 16) * * @param int $length * @return string + * + * @deprecated since version 5.2. Use random_bytes instead. */ public static function randomBytes($length = 16) { @@ -255,7 +260,7 @@ public static function quickRandom($length = 16) { $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - return substr(str_shuffle(str_repeat($pool, $length)), 0, $length); + return static::substr(str_shuffle(str_repeat($pool, $length)), 0, $length); } /** @@ -268,34 +273,50 @@ public static function quickRandom($length = 16) * @param string $knownString * @param string $userInput * @return bool + * + * @deprecated since version 5.2. Use hash_equals instead. */ public static function equals($knownString, $userInput) { - if (! is_string($knownString)) { - $knownString = (string) $knownString; - } + return hash_equals($knownString, $userInput); + } - if (! is_string($userInput)) { - $userInput = (string) $userInput; - } + /** + * Replace the first occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + public static function replaceFirst($search, $replace, $subject) + { + $position = strpos($subject, $search); - if (function_exists('hash_equals')) { - return hash_equals($knownString, $userInput); + if ($position !== false) { + return substr_replace($subject, $replace, $position, strlen($search)); } - $knownLength = mb_strlen($knownString, '8bit'); - - if (mb_strlen($userInput, '8bit') !== $knownLength) { - return false; - } + return $subject; + } - $result = 0; + /** + * Replace the last occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + public static function replaceLast($search, $replace, $subject) + { + $position = strrpos($subject, $search); - for ($i = 0; $i < $knownLength; ++$i) { - $result |= (ord($knownString[$i]) ^ ord($userInput[$i])); + if ($position !== false) { + return substr_replace($subject, $replace, $position, strlen($search)); } - return 0 === $result; + return $subject; } /** @@ -440,4 +461,138 @@ public static function ucfirst($string) { return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); } + + /** + * Returns the replacements for the ascii method. + * + * Note: Adapted from Stringy\Stringy. + * + * @see https://github.com/danielstjules/Stringy/blob/2.3.1/LICENSE.txt + * + * @return array + */ + protected static function charsArray() + { + static $charsArray; + + if (isset($charsArray)) { + return $charsArray; + } + + return $charsArray = [ + '0' => ['°', '₀', '۰'], + '1' => ['¹', '₁', '۱'], + '2' => ['²', '₂', '۲'], + '3' => ['³', '₃', '۳'], + '4' => ['⁴', '₄', '۴', '٤'], + '5' => ['⁵', '₅', '۵', '٥'], + '6' => ['⁶', '₆', '۶', '٦'], + '7' => ['⁷', '₇', '۷'], + '8' => ['⁸', '₈', '۸'], + '9' => ['⁹', '₉', '۹'], + 'a' => ['à', 'á', 'ả', 'ã', 'ạ', 'ă', 'ắ', 'ằ', 'ẳ', 'ẵ', 'ặ', 'â', 'ấ', 'ầ', 'ẩ', 'ẫ', 'ậ', 'ā', 'ą', 'å', 'α', 'ά', 'ἀ', 'ἁ', 'ἂ', 'ἃ', 'ἄ', 'ἅ', 'ἆ', 'ἇ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ὰ', 'ά', 'ᾰ', 'ᾱ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'а', 'أ', 'အ', 'ာ', 'ါ', 'ǻ', 'ǎ', 'ª', 'ა', 'अ', 'ا'], + 'b' => ['б', 'β', 'Ъ', 'Ь', 'ب', 'ဗ', 'ბ'], + 'c' => ['ç', 'ć', 'č', 'ĉ', 'ċ'], + 'd' => ['ď', 'ð', 'đ', 'ƌ', 'ȡ', 'ɖ', 'ɗ', 'ᵭ', 'ᶁ', 'ᶑ', 'д', 'δ', 'د', 'ض', 'ဍ', 'ဒ', 'დ'], + 'e' => ['é', 'è', 'ẻ', 'ẽ', 'ẹ', 'ê', 'ế', 'ề', 'ể', 'ễ', 'ệ', 'ë', 'ē', 'ę', 'ě', 'ĕ', 'ė', 'ε', 'έ', 'ἐ', 'ἑ', 'ἒ', 'ἓ', 'ἔ', 'ἕ', 'ὲ', 'έ', 'е', 'ё', 'э', 'є', 'ə', 'ဧ', 'ေ', 'ဲ', 'ე', 'ए', 'إ', 'ئ'], + 'f' => ['ф', 'φ', 'ف', 'ƒ', 'ფ'], + 'g' => ['ĝ', 'ğ', 'ġ', 'ģ', 'г', 'ґ', 'γ', 'ဂ', 'გ', 'گ'], + 'h' => ['ĥ', 'ħ', 'η', 'ή', 'ح', 'ه', 'ဟ', 'ှ', 'ჰ'], + 'i' => ['í', 'ì', 'ỉ', 'ĩ', 'ị', 'î', 'ï', 'ī', 'ĭ', 'į', 'ı', 'ι', 'ί', 'ϊ', 'ΐ', 'ἰ', 'ἱ', 'ἲ', 'ἳ', 'ἴ', 'ἵ', 'ἶ', 'ἷ', 'ὶ', 'ί', 'ῐ', 'ῑ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'і', 'ї', 'и', 'ဣ', 'ိ', 'ီ', 'ည်', 'ǐ', 'ი', 'इ'], + 'j' => ['ĵ', 'ј', 'Ј', 'ჯ', 'ج'], + 'k' => ['ķ', 'ĸ', 'к', 'κ', 'Ķ', 'ق', 'ك', 'က', 'კ', 'ქ', 'ک'], + 'l' => ['ł', 'ľ', 'ĺ', 'ļ', 'ŀ', 'л', 'λ', 'ل', 'လ', 'ლ'], + 'm' => ['м', 'μ', 'م', 'မ', 'მ'], + 'n' => ['ñ', 'ń', 'ň', 'ņ', 'ʼn', 'ŋ', 'ν', 'н', 'ن', 'န', 'ნ'], + 'o' => ['ó', 'ò', 'ỏ', 'õ', 'ọ', 'ô', 'ố', 'ồ', 'ổ', 'ỗ', 'ộ', 'ơ', 'ớ', 'ờ', 'ở', 'ỡ', 'ợ', 'ø', 'ō', 'ő', 'ŏ', 'ο', 'ὀ', 'ὁ', 'ὂ', 'ὃ', 'ὄ', 'ὅ', 'ὸ', 'ό', 'о', 'و', 'θ', 'ို', 'ǒ', 'ǿ', 'º', 'ო', 'ओ'], + 'p' => ['п', 'π', 'ပ', 'პ', 'پ'], + 'q' => ['ყ'], + 'r' => ['ŕ', 'ř', 'ŗ', 'р', 'ρ', 'ر', 'რ'], + 's' => ['ś', 'š', 'ş', 'с', 'σ', 'ș', 'ς', 'س', 'ص', 'စ', 'ſ', 'ს'], + 't' => ['ť', 'ţ', 'т', 'τ', 'ț', 'ت', 'ط', 'ဋ', 'တ', 'ŧ', 'თ', 'ტ'], + 'u' => ['ú', 'ù', 'ủ', 'ũ', 'ụ', 'ư', 'ứ', 'ừ', 'ử', 'ữ', 'ự', 'û', 'ū', 'ů', 'ű', 'ŭ', 'ų', 'µ', 'у', 'ဉ', 'ု', 'ူ', 'ǔ', 'ǖ', 'ǘ', 'ǚ', 'ǜ', 'უ', 'उ'], + 'v' => ['в', 'ვ', 'ϐ'], + 'w' => ['ŵ', 'ω', 'ώ', 'ဝ', 'ွ'], + 'x' => ['χ', 'ξ'], + 'y' => ['ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ', 'ÿ', 'ŷ', 'й', 'ы', 'υ', 'ϋ', 'ύ', 'ΰ', 'ي', 'ယ'], + 'z' => ['ź', 'ž', 'ż', 'з', 'ζ', 'ز', 'ဇ', 'ზ'], + 'aa' => ['ع', 'आ', 'آ'], + 'ae' => ['ä', 'æ', 'ǽ'], + 'ai' => ['ऐ'], + 'at' => ['@'], + 'ch' => ['ч', 'ჩ', 'ჭ', 'چ'], + 'dj' => ['ђ', 'đ'], + 'dz' => ['џ', 'ძ'], + 'ei' => ['ऍ'], + 'gh' => ['غ', 'ღ'], + 'ii' => ['ई'], + 'ij' => ['ij'], + 'kh' => ['х', 'خ', 'ხ'], + 'lj' => ['љ'], + 'nj' => ['њ'], + 'oe' => ['ö', 'œ', 'ؤ'], + 'oi' => ['ऑ'], + 'oii' => ['ऒ'], + 'ps' => ['ψ'], + 'sh' => ['ш', 'შ', 'ش'], + 'shch' => ['щ'], + 'ss' => ['ß'], + 'sx' => ['ŝ'], + 'th' => ['þ', 'ϑ', 'ث', 'ذ', 'ظ'], + 'ts' => ['ц', 'ც', 'წ'], + 'ue' => ['ü'], + 'uu' => ['ऊ'], + 'ya' => ['я'], + 'yu' => ['ю'], + 'zh' => ['ж', 'ჟ', 'ژ'], + '(c)' => ['©'], + 'A' => ['Á', 'À', 'Ả', 'Ã', 'Ạ', 'Ă', 'Ắ', 'Ằ', 'Ẳ', 'Ẵ', 'Ặ', 'Â', 'Ấ', 'Ầ', 'Ẩ', 'Ẫ', 'Ậ', 'Å', 'Ā', 'Ą', 'Α', 'Ά', 'Ἀ', 'Ἁ', 'Ἂ', 'Ἃ', 'Ἄ', 'Ἅ', 'Ἆ', 'Ἇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'Ᾰ', 'Ᾱ', 'Ὰ', 'Ά', 'ᾼ', 'А', 'Ǻ', 'Ǎ'], + 'B' => ['Б', 'Β', 'ब'], + 'C' => ['Ç', 'Ć', 'Č', 'Ĉ', 'Ċ'], + 'D' => ['Ď', 'Ð', 'Đ', 'Ɖ', 'Ɗ', 'Ƌ', 'ᴅ', 'ᴆ', 'Д', 'Δ'], + 'E' => ['É', 'È', 'Ẻ', 'Ẽ', 'Ẹ', 'Ê', 'Ế', 'Ề', 'Ể', 'Ễ', 'Ệ', 'Ë', 'Ē', 'Ę', 'Ě', 'Ĕ', 'Ė', 'Ε', 'Έ', 'Ἐ', 'Ἑ', 'Ἒ', 'Ἓ', 'Ἔ', 'Ἕ', 'Έ', 'Ὲ', 'Е', 'Ё', 'Э', 'Є', 'Ə'], + 'F' => ['Ф', 'Φ'], + 'G' => ['Ğ', 'Ġ', 'Ģ', 'Г', 'Ґ', 'Γ'], + 'H' => ['Η', 'Ή', 'Ħ'], + 'I' => ['Í', 'Ì', 'Ỉ', 'Ĩ', 'Ị', 'Î', 'Ï', 'Ī', 'Ĭ', 'Į', 'İ', 'Ι', 'Ί', 'Ϊ', 'Ἰ', 'Ἱ', 'Ἳ', 'Ἴ', 'Ἵ', 'Ἶ', 'Ἷ', 'Ῐ', 'Ῑ', 'Ὶ', 'Ί', 'И', 'І', 'Ї', 'Ǐ', 'ϒ'], + 'K' => ['К', 'Κ'], + 'L' => ['Ĺ', 'Ł', 'Л', 'Λ', 'Ļ', 'Ľ', 'Ŀ', 'ल'], + 'M' => ['М', 'Μ'], + 'N' => ['Ń', 'Ñ', 'Ň', 'Ņ', 'Ŋ', 'Н', 'Ν'], + 'O' => ['Ó', 'Ò', 'Ỏ', 'Õ', 'Ọ', 'Ô', 'Ố', 'Ồ', 'Ổ', 'Ỗ', 'Ộ', 'Ơ', 'Ớ', 'Ờ', 'Ở', 'Ỡ', 'Ợ', 'Ø', 'Ō', 'Ő', 'Ŏ', 'Ο', 'Ό', 'Ὀ', 'Ὁ', 'Ὂ', 'Ὃ', 'Ὄ', 'Ὅ', 'Ὸ', 'Ό', 'О', 'Θ', 'Ө', 'Ǒ', 'Ǿ'], + 'P' => ['П', 'Π'], + 'R' => ['Ř', 'Ŕ', 'Р', 'Ρ', 'Ŗ'], + 'S' => ['Ş', 'Ŝ', 'Ș', 'Š', 'Ś', 'С', 'Σ'], + 'T' => ['Ť', 'Ţ', 'Ŧ', 'Ț', 'Т', 'Τ'], + 'U' => ['Ú', 'Ù', 'Ủ', 'Ũ', 'Ụ', 'Ư', 'Ứ', 'Ừ', 'Ử', 'Ữ', 'Ự', 'Û', 'Ū', 'Ů', 'Ű', 'Ŭ', 'Ų', 'У', 'Ǔ', 'Ǖ', 'Ǘ', 'Ǚ', 'Ǜ'], + 'V' => ['В'], + 'W' => ['Ω', 'Ώ', 'Ŵ'], + 'X' => ['Χ', 'Ξ'], + 'Y' => ['Ý', 'Ỳ', 'Ỷ', 'Ỹ', 'Ỵ', 'Ÿ', 'Ῠ', 'Ῡ', 'Ὺ', 'Ύ', 'Ы', 'Й', 'Υ', 'Ϋ', 'Ŷ'], + 'Z' => ['Ź', 'Ž', 'Ż', 'З', 'Ζ'], + 'AE' => ['Ä', 'Æ', 'Ǽ'], + 'CH' => ['Ч'], + 'DJ' => ['Ђ'], + 'DZ' => ['Џ'], + 'GX' => ['Ĝ'], + 'HX' => ['Ĥ'], + 'IJ' => ['IJ'], + 'JX' => ['Ĵ'], + 'KH' => ['Х'], + 'LJ' => ['Љ'], + 'NJ' => ['Њ'], + 'OE' => ['Ö', 'Œ'], + 'PS' => ['Ψ'], + 'SH' => ['Ш'], + 'SHCH' => ['Щ'], + 'SS' => ['ẞ'], + 'TH' => ['Þ'], + 'TS' => ['Ц'], + 'UE' => ['Ü'], + 'YA' => ['Я'], + 'YU' => ['Ю'], + 'ZH' => ['Ж'], + ' ' => ["\xC2\xA0", "\xE2\x80\x80", "\xE2\x80\x81", "\xE2\x80\x82", "\xE2\x80\x83", "\xE2\x80\x84", "\xE2\x80\x85", "\xE2\x80\x86", "\xE2\x80\x87", "\xE2\x80\x88", "\xE2\x80\x89", "\xE2\x80\x8A", "\xE2\x80\xAF", "\xE2\x81\x9F", "\xE3\x80\x80"], + ]; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php b/application/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php index a6a54fd..2c103d4 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php @@ -48,15 +48,15 @@ public static function hasMacro($name) */ public static function __callStatic($method, $parameters) { - if (static::hasMacro($method)) { - if (static::$macros[$method] instanceof Closure) { - return call_user_func_array(Closure::bind(static::$macros[$method], null, get_called_class()), $parameters); - } else { - return call_user_func_array(static::$macros[$method], $parameters); - } + if (! static::hasMacro($method)) { + throw new BadMethodCallException("Method {$method} does not exist."); } - throw new BadMethodCallException("Method {$method} does not exist."); + if (static::$macros[$method] instanceof Closure) { + return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters); + } + + return call_user_func_array(static::$macros[$method], $parameters); } /** @@ -70,14 +70,14 @@ public static function __callStatic($method, $parameters) */ public function __call($method, $parameters) { - if (static::hasMacro($method)) { - if (static::$macros[$method] instanceof Closure) { - return call_user_func_array(static::$macros[$method]->bindTo($this, get_class($this)), $parameters); - } else { - return call_user_func_array(static::$macros[$method], $parameters); - } + if (! static::hasMacro($method)) { + throw new BadMethodCallException("Method {$method} does not exist."); + } + + if (static::$macros[$method] instanceof Closure) { + return call_user_func_array(static::$macros[$method]->bindTo($this, static::class), $parameters); } - throw new BadMethodCallException("Method {$method} does not exist."); + return call_user_func_array(static::$macros[$method], $parameters); } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/composer.json b/application/vendor/laravel/framework/src/Illuminate/Support/composer.json index a96f06a..625471b 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Support/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Support/composer.json @@ -10,17 +10,19 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", "ext-mbstring": "*", - "illuminate/contracts": "5.1.*", "doctrine/inflector": "~1.0", - "danielstjules/stringy": "~1.8", + "illuminate/contracts": "5.2.*", "paragonie/random_compat": "~1.4" }, + "replace": { + "tightenco/collect": "self.version" + }, "autoload": { "psr-4": { "Illuminate\\Support\\": "" @@ -31,12 +33,15 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { - "jeremeamia/superclosure": "Required to be able to serialize closures (~2.0).", - "symfony/var-dumper": "Improves the dd function (2.7.*)." + "illuminate/filesystem": "Required to use the composer class (5.2.*).", + "jeremeamia/superclosure": "Required to be able to serialize closures (~2.2).", + "symfony/polyfill-php56": "Required to use the hash_equals function on PHP 5.5 (~1.0).", + "symfony/process": "Required to use the composer class (2.8.*|3.0.*).", + "symfony/var-dumper": "Improves the dd function (2.8.*|3.0.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/Support/helpers.php b/application/vendor/laravel/framework/src/Illuminate/Support/helpers.php old mode 100644 new mode 100755 index 3ea27f5..4294cfc --- a/application/vendor/laravel/framework/src/Illuminate/Support/helpers.php +++ b/application/vendor/laravel/framework/src/Illuminate/Support/helpers.php @@ -51,6 +51,8 @@ function array_add($array, $key, $value) * @param array $array * @param callable $callback * @return array + * + * @deprecated since version 5.2. */ function array_build($array, callable $callback) { @@ -62,7 +64,7 @@ function array_build($array, callable $callback) /** * Collapse an array of arrays into a single array. * - * @param \ArrayAccess|array $array + * @param array $array * @return array */ function array_collapse($array) @@ -112,32 +114,16 @@ function array_except($array, $keys) } } -if (! function_exists('array_fetch')) { - /** - * Fetch a flattened array of a nested array element. - * - * @param array $array - * @param string $key - * @return array - * - * @deprecated since version 5.1. Use array_pluck instead. - */ - function array_fetch($array, $key) - { - return Arr::fetch($array, $key); - } -} - if (! function_exists('array_first')) { /** * Return the first element in an array passing a given truth test. * * @param array $array - * @param callable $callback + * @param callable|null $callback * @param mixed $default * @return mixed */ - function array_first($array, callable $callback, $default = null) + function array_first($array, callable $callback = null, $default = null) { return Arr::first($array, $callback, $default); } @@ -148,11 +134,12 @@ function array_first($array, callable $callback, $default = null) * Flatten a multi-dimensional array into a single level. * * @param array $array + * @param int $depth * @return array */ - function array_flatten($array) + function array_flatten($array, $depth = INF) { - return Arr::flatten($array); + return Arr::flatten($array, $depth); } } @@ -174,7 +161,7 @@ function array_forget(&$array, $keys) /** * Get an item from an array using "dot" notation. * - * @param array $array + * @param \ArrayAccess|array $array * @param string $key * @param mixed $default * @return mixed @@ -189,7 +176,7 @@ function array_get($array, $key, $default = null) /** * Check if an item exists in an array using "dot" notation. * - * @param array $array + * @param \ArrayAccess|array $array * @param string $key * @return bool */ @@ -204,11 +191,11 @@ function array_has($array, $key) * Return the last element in an array passing a given truth test. * * @param array $array - * @param callable $callback + * @param callable|null $callback * @param mixed $default * @return mixed */ - function array_last($array, $callback, $default = null) + function array_last($array, callable $callback = null, $default = null) { return Arr::last($array, $callback, $default); } @@ -391,6 +378,21 @@ function collect($value = null) } } +if (! function_exists('data_fill')) { + /** + * Fill in data where it's missing. + * + * @param mixed $target + * @param string|array $key + * @param mixed $value + * @return mixed + */ + function data_fill(&$target, $key, $value) + { + return data_set($target, $key, $value, false); + } +} + if (! function_exists('data_get')) { /** * Get an item from an array or object using "dot" notation. @@ -408,27 +410,87 @@ function data_get($target, $key, $default = null) $key = is_array($key) ? $key : explode('.', $key); - foreach ($key as $segment) { - if (is_array($target)) { - if (! array_key_exists($segment, $target)) { + while (($segment = array_shift($key)) !== null) { + if ($segment === '*') { + if ($target instanceof Collection) { + $target = $target->all(); + } elseif (! is_array($target)) { return value($default); } + $result = Arr::pluck($target, $key); + + return in_array('*', $key) ? Arr::collapse($result) : $result; + } + + if (Arr::accessible($target) && Arr::exists($target, $segment)) { $target = $target[$segment]; - } elseif ($target instanceof ArrayAccess) { - if (! isset($target[$segment])) { - return value($default); + } elseif (is_object($target) && isset($target->{$segment})) { + $target = $target->{$segment}; + } else { + return value($default); + } + } + + return $target; + } +} + +if (! function_exists('data_set')) { + /** + * Set an item on an array or object using dot notation. + * + * @param mixed $target + * @param string|array $key + * @param mixed $value + * @param bool $overwrite + * @return mixed + */ + function data_set(&$target, $key, $value, $overwrite = true) + { + $segments = is_array($key) ? $key : explode('.', $key); + + if (($segment = array_shift($segments)) === '*') { + if (! Arr::accessible($target)) { + $target = []; + } + + if ($segments) { + foreach ($target as &$inner) { + data_set($inner, $segments, $value, $overwrite); + } + } elseif ($overwrite) { + foreach ($target as &$inner) { + $inner = $value; + } + } + } elseif (Arr::accessible($target)) { + if ($segments) { + if (! Arr::exists($target, $segment)) { + $target[$segment] = []; } - $target = $target[$segment]; - } elseif (is_object($target)) { + data_set($target[$segment], $segments, $value, $overwrite); + } elseif ($overwrite || ! Arr::exists($target, $segment)) { + $target[$segment] = $value; + } + } elseif (is_object($target)) { + if ($segments) { if (! isset($target->{$segment})) { - return value($default); + $target->{$segment} = []; } - $target = $target->{$segment}; - } else { - return value($default); + data_set($target->{$segment}, $segments, $value, $overwrite); + } elseif ($overwrite || ! isset($target->{$segment})) { + $target->{$segment} = $value; + } + } else { + $target = []; + + if ($segments) { + data_set($target[$segment], $segments, $value, $overwrite); + } elseif ($overwrite) { + $target[$segment] = $value; } } @@ -689,6 +751,36 @@ function str_replace_array($search, array $replace, $subject) } } +if (! function_exists('str_replace_first')) { + /** + * Replace the first occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + function str_replace_first($search, $replace, $subject) + { + return Str::replaceFirst($search, $replace, $subject); + } +} + +if (! function_exists('str_replace_last')) { + /** + * Replace the last occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + function str_replace_last($search, $replace, $subject) + { + return Str::replaceLast($search, $replace, $subject); + } +} + if (! function_exists('str_singular')) { /** * Get the singular form of an English word. @@ -776,7 +868,7 @@ function value($value) if (! function_exists('windows_os')) { /** - * Determine whether the current envrionment is Windows based. + * Determine whether the current environment is Windows based. * * @return bool */ diff --git a/application/vendor/laravel/framework/src/Illuminate/Translation/ArrayLoader.php b/application/vendor/laravel/framework/src/Illuminate/Translation/ArrayLoader.php new file mode 100644 index 0000000..17d6c8b --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Translation/ArrayLoader.php @@ -0,0 +1,62 @@ +messages[$namespace][$locale][$group])) { + return $this->messages[$namespace][$locale][$group]; + } + + return []; + } + + /** + * Add a new namespace to the loader. + * + * @param string $namespace + * @param string $hint + * @return void + */ + public function addNamespace($namespace, $hint) + { + // + } + + /** + * Add messages to the loader. + * + * @param string $locale + * @param string $group + * @param array $messages + * @param string|null $namespace + * @return $this + */ + public function addMessages($locale, $group, array $messages, $namespace = null) + { + $namespace = $namespace ?: '*'; + + $this->messages[$namespace][$locale][$group] = $messages; + + return $this; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Translation/FileLoader.php b/application/vendor/laravel/framework/src/Illuminate/Translation/FileLoader.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Translation/LoaderInterface.php b/application/vendor/laravel/framework/src/Illuminate/Translation/LoaderInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Translation/TranslationServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Translation/Translator.php b/application/vendor/laravel/framework/src/Illuminate/Translation/Translator.php old mode 100644 new mode 100755 index 62f09c7..5c40312 --- a/application/vendor/laravel/framework/src/Illuminate/Translation/Translator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Translation/Translator.php @@ -3,6 +3,7 @@ namespace Illuminate\Translation; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use Illuminate\Support\Collection; use Illuminate\Support\NamespacedItemResolver; use Symfony\Component\Translation\MessageSelector; @@ -38,6 +39,13 @@ class Translator extends NamespacedItemResolver implements TranslatorInterface */ protected $loaded = []; + /** + * The message selector. + * + * @var \Symfony\Component\Translation\MessageSelector + */ + protected $selector; + /** * Create a new translator instance. * @@ -83,7 +91,7 @@ public function has($key, $locale = null, $fallback = true) * @param array $replace * @param string|null $locale * @param bool $fallback - * @return string + * @return string|array|null */ public function get($key, array $replace = [], $locale = null, $fallback = true) { @@ -149,7 +157,11 @@ protected function makeReplacements($line, array $replace) $replace = $this->sortReplacements($replace); foreach ($replace as $key => $value) { - $line = str_replace(':'.$key, $value, $line); + $line = str_replace( + [':'.$key, ':'.Str::upper($key), ':'.Str::ucfirst($key)], + [$value, Str::upper($value), Str::ucfirst($value)], + $line + ); } return $line; @@ -172,7 +184,7 @@ protected function sortReplacements(array $replace) * Get a translation according to an integer value. * * @param string $key - * @param int $number + * @param int|array|\Countable $number * @param array $replace * @param string $locale * @return string @@ -181,6 +193,10 @@ public function choice($key, $number, array $replace = [], $locale = null) { $line = $this->get($key, $replace, $locale = $locale ?: $this->locale ?: $this->fallback); + if (is_array($number) || $number instanceof \Countable) { + $number = count($number); + } + $replace['count'] = $number; return $this->makeReplacements($this->getSelector()->choose($line, $number, $locale), $replace); @@ -193,7 +209,7 @@ public function choice($key, $number, array $replace = [], $locale = null) * @param array $parameters * @param string $domain * @param string $locale - * @return string + * @return string|array|null */ public function trans($id, array $parameters = [], $domain = 'messages', $locale = null) { @@ -204,7 +220,7 @@ public function trans($id, array $parameters = [], $domain = 'messages', $locale * Get a translation according to an integer value. * * @param string $id - * @param int $number + * @param int|array|\Countable $number * @param array $parameters * @param string $domain * @param string $locale @@ -287,11 +303,7 @@ public function parseKey($key) */ protected function parseLocale($locale) { - if (! is_null($locale)) { - return array_filter([$locale, $this->fallback]); - } - - return array_filter([$this->locale, $this->fallback]); + return array_filter([$locale ?: $this->locale, $this->fallback]); } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/Translation/composer.json b/application/vendor/laravel/framework/src/Illuminate/Translation/composer.json old mode 100644 new mode 100755 index e3e355d..0980867 --- a/application/vendor/laravel/framework/src/Illuminate/Translation/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Translation/composer.json @@ -10,14 +10,14 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/filesystem": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/translation": "2.7.*" + "illuminate/filesystem": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/translation": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -26,7 +26,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php b/application/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php old mode 100644 new mode 100755 index 42aa353..7b0b0e5 --- a/application/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php +++ b/application/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php @@ -2,6 +2,7 @@ namespace Illuminate\Validation; +use Illuminate\Support\Str; use Illuminate\Database\ConnectionResolverInterface; class DatabasePresenceVerifier implements PresenceVerifierInterface @@ -91,6 +92,8 @@ protected function addWhere($query, $key, $extraValue) $query->whereNull($key); } elseif ($extraValue === 'NOT_NULL') { $query->whereNotNull($key); + } elseif (Str::startsWith($extraValue, '!')) { + $query->where($key, '!=', mb_substr($extraValue, 1)); } else { $query->where($key, $extraValue); } diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/Factory.php b/application/vendor/laravel/framework/src/Illuminate/Validation/Factory.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php b/application/vendor/laravel/framework/src/Illuminate/Validation/PresenceVerifierInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php b/application/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php index 5b19fc7..d2b5a79 100644 --- a/application/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php +++ b/application/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php @@ -2,8 +2,8 @@ namespace Illuminate\Validation; -use Illuminate\Contracts\Validation\ValidationException; use Illuminate\Contracts\Validation\UnauthorizedException; +use Illuminate\Contracts\Validation\ValidationException as ValidationExceptionContract; /** * Provides default implementation of ValidatesWhenResolved contract. @@ -40,11 +40,13 @@ protected function getValidatorInstance() * Handle a failed validation attempt. * * @param \Illuminate\Validation\Validator $validator - * @return mixed + * @return void + * + * @throws \Illuminate\Contracts\Validation\ValidationException */ protected function failedValidation(Validator $validator) { - throw new ValidationException($validator); + throw new ValidationExceptionContract($validator); } /** @@ -64,7 +66,9 @@ protected function passesAuthorization() /** * Handle a failed authorization attempt. * - * @return mixed + * @return void + * + * @throws \Illuminate\Contracts\Validation\UnauthorizedException */ protected function failedAuthorization() { diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php b/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php new file mode 100644 index 0000000..56d253f --- /dev/null +++ b/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php @@ -0,0 +1,47 @@ +response = $response; + $this->validator = $validator; + } + + /** + * Get the underlying response instance. + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function getResponse() + { + return $this->response; + } +} diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php old mode 100644 new mode 100755 index 5eaf08f..af01174 --- a/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php +++ b/application/vendor/laravel/framework/src/Illuminate/Validation/ValidationServiceProvider.php @@ -3,10 +3,16 @@ namespace Illuminate\Validation; use Illuminate\Support\ServiceProvider; -use Illuminate\Contracts\Validation\ValidatesWhenResolved; class ValidationServiceProvider extends ServiceProvider { + /** + * Indicates if loading of the provider is deferred. + * + * @var bool + */ + protected $defer = true; + /** * Register the service provider. * @@ -14,25 +20,11 @@ class ValidationServiceProvider extends ServiceProvider */ public function register() { - $this->registerValidationResolverHook(); - $this->registerPresenceVerifier(); $this->registerValidationFactory(); } - /** - * Register the "ValidatesWhenResolved" container hook. - * - * @return void - */ - protected function registerValidationResolverHook() - { - $this->app->afterResolving(function (ValidatesWhenResolved $resolved) { - $resolved->validate(); - }); - } - /** * Register the validation factory. * @@ -65,4 +57,16 @@ protected function registerPresenceVerifier() return new DatabasePresenceVerifier($app['db']); }); } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return [ + 'validator', 'validation.presence', + ]; + } } diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/Validator.php b/application/vendor/laravel/framework/src/Illuminate/Validation/Validator.php old mode 100644 new mode 100755 index 9c5e74d..ce1e001 --- a/application/vendor/laravel/framework/src/Illuminate/Validation/Validator.php +++ b/application/vendor/laravel/framework/src/Illuminate/Validation/Validator.php @@ -7,11 +7,11 @@ use Countable; use Exception; use DateTimeZone; -use Carbon\Carbon; use RuntimeException; -use BadMethodCallException; +use DateTimeInterface; use Illuminate\Support\Arr; use Illuminate\Support\Str; +use BadMethodCallException; use InvalidArgumentException; use Illuminate\Support\Fluent; use Illuminate\Support\MessageBag; @@ -72,6 +72,13 @@ class Validator implements ValidatorContract */ protected $files = []; + /** + * The initial rules provided. + * + * @var array + */ + protected $initialRules; + /** * The rules to be applied to the data. * @@ -79,6 +86,13 @@ class Validator implements ValidatorContract */ protected $rules; + /** + * The array of wildcard attributes with their asterisks expanded. + * + * @var array + */ + protected $implicitAttributes = []; + /** * All of the registered "after" callbacks. * @@ -108,7 +122,7 @@ class Validator implements ValidatorContract protected $customAttributes = []; /** - * The array of custom displayabled values. + * The array of custom displayable values. * * @var array */ @@ -148,7 +162,20 @@ class Validator implements ValidatorContract * @var array */ protected $implicitRules = [ - 'Required', 'RequiredWith', 'RequiredWithAll', 'RequiredWithout', 'RequiredWithoutAll', 'RequiredIf', 'RequiredUnless', 'Accepted', + 'Required', 'Filled', 'RequiredWith', 'RequiredWithAll', 'RequiredWithout', 'RequiredWithoutAll', + 'RequiredIf', 'RequiredUnless', 'Accepted', 'Present', + // 'Array', 'Boolean', 'Integer', 'Numeric', 'String', + ]; + + /** + * The validation rules which depend on other fields as parameters. + * + * @var array + */ + protected $dependentRules = [ + 'RequiredWith', 'RequiredWithAll', 'RequiredWithout', 'RequiredWithoutAll', + 'RequiredIf', 'RequiredUnless', 'Confirmed', 'Same', 'Different', 'Unique', + 'Before', 'After', ]; /** @@ -166,8 +193,10 @@ public function __construct(TranslatorInterface $translator, array $data, array $this->translator = $translator; $this->customMessages = $messages; $this->data = $this->parseData($data); - $this->rules = $this->explodeRules($rules); $this->customAttributes = $customAttributes; + $this->initialRules = $rules; + + $this->setRules($rules); } /** @@ -209,8 +238,14 @@ protected function parseData(array $data, $arrayKey = null) */ protected function explodeRules($rules) { - foreach ($rules as $key => &$rule) { - $rule = (is_string($rule)) ? explode('|', $rule) : $rule; + foreach ($rules as $key => $rule) { + if (Str::contains($key, '*')) { + $this->each($key, [$rule]); + + unset($rules[$key]); + } else { + $rules[$key] = (is_string($rule)) ? explode('|', $rule) : $rule; + } } return $rules; @@ -241,11 +276,15 @@ public function after($callback) */ public function sometimes($attribute, $rules, callable $callback) { - $payload = new Fluent(array_merge($this->data, $this->files)); + $payload = new Fluent($this->attributes()); if (call_user_func($callback, $payload)) { foreach ((array) $attribute as $key) { - $this->mergeRules($key, $rules); + if (Str::contains($key, '*')) { + $this->explodeRules([$key => $rules]); + } else { + $this->mergeRules($key, $rules); + } } } } @@ -261,25 +300,94 @@ public function sometimes($attribute, $rules, callable $callback) */ public function each($attribute, $rules) { - $data = Arr::get($this->data, $attribute); + $data = Arr::dot($this->initializeAttributeOnData($attribute)); + + $pattern = str_replace('\*', '[^\.]+', preg_quote($attribute)); + + $data = array_merge($data, $this->extractValuesForWildcards( + $data, $attribute + )); - if (! is_array($data)) { - if ($this->hasRule($attribute, 'Array')) { - return; + foreach ($data as $key => $value) { + if (Str::startsWith($key, $attribute) || (bool) preg_match('/^'.$pattern.'\z/', $key)) { + foreach ((array) $rules as $ruleKey => $ruleValue) { + if (! is_string($ruleKey) || Str::endsWith($key, $ruleKey)) { + $this->implicitAttributes[$attribute][] = $key; + + $this->mergeRules($key, $ruleValue); + } + } } + } + } + + /** + * Gather a copy of the attribute data filled with any missing attributes. + * + * @param string $attribute + * @return array + */ + protected function initializeAttributeOnData($attribute) + { + $explicitPath = $this->getLeadingExplicitAttributePath($attribute); - throw new InvalidArgumentException('Attribute for each() must be an array.'); + $data = $this->extractDataFromPath($explicitPath); + + if (! Str::contains($attribute, '*') || Str::endsWith($attribute, '*')) { + return $data; } - foreach ($data as $dataKey => $dataValue) { - foreach ((array) $rules as $ruleKey => $ruleValue) { - if (! is_string($ruleKey)) { - $this->mergeRules("$attribute.$dataKey", $ruleValue); - } else { - $this->mergeRules("$attribute.$dataKey.$ruleKey", $ruleValue); - } + return data_set($data, $attribute, null, true); + } + + /** + * Get all of the exact attribute values for a given wildcard attribute. + * + * @param array $data + * @param string $attribute + * @return array + */ + public function extractValuesForWildcards($data, $attribute) + { + $keys = []; + + $pattern = str_replace('\*', '[^\.]+', preg_quote($attribute)); + + foreach ($data as $key => $value) { + if ((bool) preg_match('/^'.$pattern.'/', $key, $matches)) { + $keys[] = $matches[0]; + } + } + + $keys = array_unique($keys); + + $data = []; + + foreach ($keys as $key) { + $data[$key] = array_get($this->data, $key); + } + + return $data; + } + + /** + * Merge additional rules into a given attribute(s). + * + * @param string $attribute + * @param string|array $rules + * @return $this + */ + public function mergeRules($attribute, $rules = []) + { + if (is_array($attribute)) { + foreach ($attribute as $innerAttribute => $innerRules) { + $this->mergeRulesForAttribute($innerAttribute, $innerRules); } + + return $this; } + + return $this->mergeRulesForAttribute($attribute, $rules); } /** @@ -287,15 +395,17 @@ public function each($attribute, $rules) * * @param string $attribute * @param string|array $rules - * @return void + * @return $this */ - public function mergeRules($attribute, $rules) + protected function mergeRulesForAttribute($attribute, $rules) { $current = isset($this->rules[$attribute]) ? $this->rules[$attribute] : []; $merge = head($this->explodeRules([$rules])); $this->rules[$attribute] = array_merge($current, $merge); + + return $this; } /** @@ -313,6 +423,10 @@ public function passes() foreach ($this->rules as $attribute => $rules) { foreach ($rules as $rule) { $this->validate($attribute, $rule); + + if ($this->shouldStopValidating($attribute)) { + break; + } } } @@ -323,7 +437,7 @@ public function passes() call_user_func($after); } - return count($this->messages->all()) === 0; + return $this->messages->isEmpty(); } /** @@ -351,6 +465,14 @@ protected function validate($attribute, $rule) return; } + // First we will get the correct keys for the given attribute in case the field is nested in + // an array. Then we determine if the given rule accepts other field names as parameters. + // If so, we will replace any asterisks found in the parameters with the correct keys. + if (($keys = $this->getExplicitKeys($attribute)) && + $this->dependsOnOtherFields($rule)) { + $parameters = $this->replaceAsterisksInParameters($parameters, $keys); + } + // We will get the value for the given attribute from the array of data and then // verify that the attribute is indeed validatable. Unless the rule implies // that the attribute is required, rules are not run for missing values. @@ -376,7 +498,9 @@ public function valid() $this->passes(); } - return array_diff_key($this->data, $this->messages()->toArray()); + return array_diff_key( + $this->data, $this->attributesThatHaveMessages() + ); } /** @@ -390,7 +514,25 @@ public function invalid() $this->passes(); } - return array_intersect_key($this->data, $this->messages()->toArray()); + return array_intersect_key( + $this->data, $this->attributesThatHaveMessages() + ); + } + + /** + * Generate an array of all attributes that have messages. + * + * @return array + */ + protected function attributesThatHaveMessages() + { + $results = []; + + foreach ($this->messages()->toArray() as $key => $message) { + $results[] = explode('.', $key)[0]; + } + + return array_flip(array_unique($results)); } /** @@ -523,6 +665,33 @@ protected function validateSometimes() return true; } + /** + * "Break" on first validation fail. + * + * Always returns true, just lets us put "bail" in rules. + * + * @return bool + */ + protected function validateBail() + { + return true; + } + + /** + * Stop on error if "bail" rule is assigned and attribute has a message. + * + * @param string $attribute + * @return bool + */ + protected function shouldStopValidating($attribute) + { + if (! $this->hasRule($attribute, ['Bail'])) { + return false; + } + + return $this->messages->has($attribute); + } + /** * Validate that a required attribute exists. * @@ -545,6 +714,18 @@ protected function validateRequired($attribute, $value) return true; } + /** + * Validate that an attribute exists even if not filled. + * + * @param string $attribute + * @param mixed $value + * @return bool + */ + protected function validatePresent($attribute, $value) + { + return Arr::has($this->data, $attribute); + } + /** * Validate the given attribute is filled if it is present. * @@ -554,7 +735,7 @@ protected function validateRequired($attribute, $value) */ protected function validateFilled($attribute, $value) { - if (array_key_exists($attribute, $this->data) || array_key_exists($attribute, $this->files)) { + if (Arr::has(array_merge($this->data, $this->files), $attribute)) { return $this->validateRequired($attribute, $value); } @@ -679,6 +860,16 @@ protected function validateRequiredIf($attribute, $value, $parameters) $values = array_slice($parameters, 1); + if (is_bool($data)) { + array_walk($values, function (&$value) { + if ($value === 'true') { + $value = true; + } elseif ($value === 'false') { + $value = false; + } + }); + } + if (in_array($data, $values)) { return $this->validateRequired($attribute, $value); } @@ -728,6 +919,29 @@ protected function getPresentCount($attributes) return $count; } + /** + * Validate that the values of an attribute is in another attribute. + * + * @param string $attribute + * @param mixed $value + * @param array $parameters + * @return bool + */ + protected function validateInArray($attribute, $value, $parameters) + { + $this->requireParameterCount(1, $parameters, 'in_array'); + + $explicitPath = $this->getLeadingExplicitAttributePath($parameters[0]); + + $attributeData = $this->extractDataFromPath($explicitPath); + + $otherValues = Arr::where(Arr::dot($attributeData), function ($key) use ($parameters) { + return Str::is($parameters[0], $key); + }); + + return in_array($value, $otherValues); + } + /** * Validate that an attribute has a matching confirmation. * @@ -799,7 +1013,11 @@ protected function validateAccepted($attribute, $value) */ protected function validateArray($attribute, $value) { - return is_array($value); + if (! $this->hasAttribute($attribute)) { + return true; + } + + return is_null($value) || is_array($value); } /** @@ -811,9 +1029,13 @@ protected function validateArray($attribute, $value) */ protected function validateBoolean($attribute, $value) { + if (! $this->hasAttribute($attribute)) { + return true; + } + $acceptable = [true, false, 0, 1, '0', '1']; - return in_array($value, $acceptable, true); + return is_null($value) || in_array($value, $acceptable, true); } /** @@ -825,7 +1047,11 @@ protected function validateBoolean($attribute, $value) */ protected function validateInteger($attribute, $value) { - return filter_var($value, FILTER_VALIDATE_INT) !== false; + if (! $this->hasAttribute($attribute)) { + return true; + } + + return is_null($value) || filter_var($value, FILTER_VALIDATE_INT) !== false; } /** @@ -837,7 +1063,11 @@ protected function validateInteger($attribute, $value) */ protected function validateNumeric($attribute, $value) { - return is_numeric($value); + if (! $this->hasAttribute($attribute)) { + return true; + } + + return is_null($value) || is_numeric($value); } /** @@ -849,7 +1079,11 @@ protected function validateNumeric($attribute, $value) */ protected function validateString($attribute, $value) { - return is_string($value); + if (! $this->hasAttribute($attribute)) { + return true; + } + + return is_null($value) || is_string($value); } /** @@ -861,6 +1095,10 @@ protected function validateString($attribute, $value) */ protected function validateJson($attribute, $value) { + if (! is_scalar($value) && ! method_exists($value, '__toString')) { + return false; + } + json_decode($value); return json_last_error() === JSON_ERROR_NONE; @@ -1003,6 +1241,12 @@ protected function getSize($attribute, $value) protected function validateIn($attribute, $value, $parameters) { if (is_array($value) && $this->hasRule($attribute, 'Array')) { + foreach ($value as $element) { + if (is_array($element)) { + return false; + } + } + return count(array_diff($value, $parameters)) == 0; } @@ -1022,6 +1266,29 @@ protected function validateNotIn($attribute, $value, $parameters) return ! $this->validateIn($attribute, $value, $parameters); } + /** + * Validate an attribute is unique among other values. + * + * @param string $attribute + * @param mixed $value + * @param array $parameters + * @return bool + */ + protected function validateDistinct($attribute, $value, $parameters) + { + $attributeName = $this->getPrimaryAttribute($attribute); + + $explicitPath = $this->getLeadingExplicitAttributePath($attributeName); + + $attributeData = $this->extractDataFromPath($explicitPath); + + $data = Arr::where(Arr::dot($attributeData), function ($key) use ($attribute, $attributeName) { + return $key != $attribute && Str::is($attributeName, $key); + }); + + return ! in_array($value, array_values($data)); + } + /** * Validate the uniqueness of an attribute value on a given database table. * @@ -1037,20 +1304,28 @@ protected function validateUnique($attribute, $value, $parameters) $this->requireParameterCount(1, $parameters, 'unique'); list($connection, $table) = $this->parseTable($parameters[0]); - // The second parameter position holds the name of the column that needs to // be verified as unique. If this parameter isn't specified we will just // assume that this column to be verified shares the attribute's name. - $column = isset($parameters[1]) ? $parameters[1] : $attribute; + $column = isset($parameters[1]) + ? $parameters[1] : $this->guessColumnForQuery($attribute); list($idColumn, $id) = [null, null]; if (isset($parameters[2])) { list($idColumn, $id) = $this->getUniqueIds($parameters); + if (preg_match('/\[(.*)\]/', $id, $matches)) { + $id = $this->getValue($matches[1]); + } + if (strtolower($id) == 'null') { $id = null; } + + if (filter_var($id, FILTER_VALIDATE_INT) !== false) { + $id = intval($id); + } } // The presence verifier is responsible for counting rows within this store @@ -1058,9 +1333,7 @@ protected function validateUnique($attribute, $value, $parameters) // data store like Redis, etc. We will use it to determine uniqueness. $verifier = $this->getPresenceVerifier(); - if (! is_null($connection)) { - $verifier->setConnection($connection); - } + $verifier->setConnection($connection); $extra = $this->getUniqueExtra($parameters); @@ -1126,11 +1399,14 @@ protected function validateExists($attribute, $value, $parameters) // The second parameter position holds the name of the column that should be // verified as existing. If this parameter is not specified we will guess // that the columns being "verified" shares the given attribute's name. - $column = isset($parameters[1]) ? $parameters[1] : $attribute; + $column = isset($parameters[1]) + ? $parameters[1] : $this->guessColumnForQuery($attribute); $expected = (is_array($value)) ? count($value) : 1; - return $this->getExistCount($connection, $table, $column, $value, $parameters) >= $expected; + return $this->getExistCount( + $connection, $table, $column, $value, $parameters + ) >= $expected; } /** @@ -1147,9 +1423,7 @@ protected function getExistCount($connection, $table, $column, $value, $paramete { $verifier = $this->getPresenceVerifier(); - if (! is_null($connection)) { - $verifier->setConnection($connection); - } + $verifier->setConnection($connection); $extra = $this->getExtraExistConditions($parameters); @@ -1190,6 +1464,22 @@ protected function getExtraConditions(array $segments) return $extra; } + /** + * Guess the database column from the given attribute name. + * + * @param string $attribute + * @return string + */ + public function guessColumnForQuery($attribute) + { + if (in_array($attribute, array_collapse($this->implicitAttributes)) + && ! is_numeric($last = last(explode('.', $attribute)))) { + return $last; + } + + return $attribute; + } + /** * Validate that an attribute is a valid IP. * @@ -1223,7 +1513,28 @@ protected function validateEmail($attribute, $value) */ protected function validateUrl($attribute, $value) { - return filter_var($value, FILTER_VALIDATE_URL) !== false; + /* + * This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (2.7.4). + * + * (c) Fabien Potencier http://symfony.com + */ + $pattern = '~^ + ((aaa|aaas|about|acap|acct|acr|adiumxtra|afp|afs|aim|apt|attachment|aw|barion|beshare|bitcoin|blob|bolo|callto|cap|chrome|chrome-extension|cid|coap|coaps|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-playcontainer|dlna-playsingle|dns|dntp|dtn|dvb|ed2k|example|facetime|fax|feed|feedready|file|filesystem|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|ham|hcp|http|https|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|ms-help|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|msnim|msrp|msrps|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|oid|opaquelocktoken|pack|palm|paparazzi|pkcs11|platform|pop|pres|prospero|proxy|psyc|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|secondlife|service|session|sftp|sgn|shttp|sieve|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|things|thismessage|tip|tn3270|turn|turns|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|videotex|view-source|wais|webcal|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc\.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39\.50|z39\.50r|z39\.50s)):// # protocol + (([\pL\pN-]+:)?([\pL\pN-]+)@)? # basic auth + ( + ([\pL\pN\pS-\.])+(\.?([\pL]|xn\-\-[\pL\pN-]+)+\.?) # a domain name + | # or + \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # a IP address + | # or + \[ + (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) + \] # a IPv6 address + ) + (:[0-9]+)? # a port (optional) + (/?|/\S+|\?\S*|\#\S*) # a /, nothing, a / with something, a query or a fragment + $~ixu'; + + return preg_match($pattern, $value) > 0; } /** @@ -1246,6 +1557,18 @@ protected function validateActiveUrl($attribute, $value) return false; } + /** + * Validate the given value is a valid file. + * + * @param string $attribute + * @param mixed $value + * @return bool + */ + protected function validateFile($attribute, $value) + { + return $this->isAValidFileInstance($value); + } + /** * Validate the MIME type of a file is an image MIME type. * @@ -1258,6 +1581,46 @@ protected function validateImage($attribute, $value) return $this->validateMimes($attribute, $value, ['jpeg', 'png', 'gif', 'bmp', 'svg']); } + /** + * Validate the dimensions of an image matches the given values. + * + * @param string $attribute + * @param mixed $value + * @param array $parameters + * @return bool + */ + protected function validateDimensions($attribute, $value, $parameters) + { + if (! $this->isAValidFileInstance($value) || ! $sizeDetails = getimagesize($value->getRealPath())) { + return false; + } + + $this->requireParameterCount(1, $parameters, 'dimensions'); + + list($width, $height) = $sizeDetails; + + $parameters = $this->parseNamedParameters($parameters); + + if ( + isset($parameters['width']) && $parameters['width'] != $width || + isset($parameters['min_width']) && $parameters['min_width'] > $width || + isset($parameters['max_width']) && $parameters['max_width'] < $width || + isset($parameters['height']) && $parameters['height'] != $height || + isset($parameters['min_height']) && $parameters['min_height'] > $height || + isset($parameters['max_height']) && $parameters['max_height'] < $height + ) { + return false; + } + + if (isset($parameters['ratio'])) { + list($numerator, $denominator) = array_pad(sscanf($parameters['ratio'], '%d/%d'), 2, 1); + + return $numerator / $denominator == $width / $height; + } + + return true; + } + /** * Validate the guessed extension of a file upload is in a set of file extensions. * @@ -1298,7 +1661,7 @@ protected function validateMimetypes($attribute, $value, $parameters) * @param mixed $value * @return bool */ - protected function isAValidFileInstance($value) + public function isAValidFileInstance($value) { if ($value instanceof UploadedFile && ! $value->isValid()) { return false; @@ -1332,7 +1695,7 @@ protected function validateAlphaNum($attribute, $value) return false; } - return preg_match('/^[\pL\pM\pN]+$/u', $value); + return preg_match('/^[\pL\pM\pN]+$/u', $value) > 0; } /** @@ -1348,7 +1711,7 @@ protected function validateAlphaDash($attribute, $value) return false; } - return preg_match('/^[\pL\pM\pN_-]+$/u', $value); + return preg_match('/^[\pL\pM\pN_-]+$/u', $value) > 0; } /** @@ -1367,7 +1730,7 @@ protected function validateRegex($attribute, $value, $parameters) $this->requireParameterCount(1, $parameters, 'regex'); - return preg_match($parameters[0], $value); + return preg_match($parameters[0], $value) > 0; } /** @@ -1425,7 +1788,7 @@ protected function validateBefore($attribute, $value, $parameters) { $this->requireParameterCount(1, $parameters, 'before'); - if (! is_string($value) && ! is_numeric($value) && ! $value instanceof Carbon) { + if (! is_string($value) && ! is_numeric($value) && ! $value instanceof DateTimeInterface) { return false; } @@ -1433,11 +1796,11 @@ protected function validateBefore($attribute, $value, $parameters) return $this->validateBeforeWithFormat($format, $value, $parameters); } - if (! ($date = strtotime($parameters[0]))) { - return strtotime($value) < strtotime($this->getValue($parameters[0])); + if (! $date = $this->getDateTimestamp($parameters[0])) { + $date = $this->getDateTimestamp($this->getValue($parameters[0])); } - return strtotime($value) < $date; + return $this->getDateTimestamp($value) < $date; } /** @@ -1467,7 +1830,7 @@ protected function validateAfter($attribute, $value, $parameters) { $this->requireParameterCount(1, $parameters, 'after'); - if (! is_string($value) && ! is_numeric($value) && ! $value instanceof Carbon) { + if (! is_string($value) && ! is_numeric($value) && ! $value instanceof DateTimeInterface) { return false; } @@ -1475,11 +1838,11 @@ protected function validateAfter($attribute, $value, $parameters) return $this->validateAfterWithFormat($format, $value, $parameters); } - if (! ($date = strtotime($parameters[0]))) { - return strtotime($value) > strtotime($this->getValue($parameters[0])); + if (! $date = $this->getDateTimestamp($parameters[0])) { + $date = $this->getDateTimestamp($this->getValue($parameters[0])); } - return strtotime($value) > $date; + return $this->getDateTimestamp($value) > $date; } /** @@ -1567,6 +1930,17 @@ protected function getDateFormat($attribute) } } + /** + * Get the date timestamp. + * + * @param mixed $value + * @return int + */ + protected function getDateTimestamp($value) + { + return $value instanceof DateTimeInterface ? $value->getTimestamp() : strtotime($value); + } + /** * Get the validation message for an attribute and rule. * @@ -1589,7 +1963,7 @@ protected function getMessage($attribute, $rule) $customKey = "validation.custom.{$attribute}.{$lowerRule}"; - $customMessage = $this->translator->trans($customKey); + $customMessage = $this->getCustomMessageFromTranslator($customKey); // First we check for a custom defined validation message for the attribute // and rule. This allows the developer to specify specific messages for @@ -1637,10 +2011,39 @@ protected function getInlineMessage($attribute, $lowerRule, $source = null) // message for the fields, then we will check for a general custom line // that is not attribute specific. If we find either we'll return it. foreach ($keys as $key) { - if (isset($source[$key])) { - return $source[$key]; + foreach (array_keys($source) as $sourceKey) { + if (Str::is($sourceKey, $key)) { + return $source[$sourceKey]; + } + } + } + } + + /** + * Get the custom error message from translator. + * + * @param string $customKey + * @return string + */ + protected function getCustomMessageFromTranslator($customKey) + { + if (($message = $this->translator->trans($customKey)) !== $customKey) { + return $message; + } + + $shortKey = preg_replace('/^validation\.custom\./', '', $customKey); + + $customMessages = Arr::dot( + (array) $this->translator->trans('validation.custom') + ); + + foreach ($customMessages as $key => $message) { + if (Str::contains($key, ['*']) && Str::is($key, $shortKey)) { + return $message; } } + + return $customKey; } /** @@ -1697,7 +2100,13 @@ protected function getAttributeType($attribute) */ protected function doReplacements($message, $attribute, $rule, $parameters) { - $message = str_replace(':attribute', $this->getAttribute($attribute), $message); + $value = $this->getAttribute($attribute); + + $message = str_replace( + [':attribute', ':ATTRIBUTE', ':Attribute'], + [$value, Str::upper($value), Str::ucfirst($value)], + $message + ); if (isset($this->replacers[Str::snake($rule)])) { $message = $this->callReplacer($message, $attribute, Str::snake($rule), $parameters); @@ -1736,28 +2145,57 @@ protected function getAttributeList(array $values) */ protected function getAttribute($attribute) { - // The developer may dynamically specify the array of custom attributes - // on this Validator instance. If the attribute exists in this array - // it takes precedence over all other ways we can pull attributes. - if (isset($this->customAttributes[$attribute])) { - return $this->customAttributes[$attribute]; - } + $primaryAttribute = $this->getPrimaryAttribute($attribute); - $key = "validation.attributes.{$attribute}"; + $expectedAttributes = $attribute != $primaryAttribute ? [$attribute, $primaryAttribute] : [$attribute]; - // We allow for the developer to specify language lines for each of the - // attributes allowing for more displayable counterparts of each of - // the attributes. This provides the ability for simple formats. - if (($line = $this->translator->trans($key)) !== $key) { - return $line; + foreach ($expectedAttributes as $expectedAttributeName) { + // The developer may dynamically specify the array of custom attributes + // on this Validator instance. If the attribute exists in this array + // it takes precedence over all other ways we can pull attributes. + if (isset($this->customAttributes[$expectedAttributeName])) { + return $this->customAttributes[$expectedAttributeName]; + } + + $key = "validation.attributes.{$expectedAttributeName}"; + + // We allow for the developer to specify language lines for each of the + // attributes allowing for more displayable counterparts of each of + // the attributes. This provides the ability for simple formats. + if (($line = $this->translator->trans($key)) !== $key) { + return $line; + } + } + + // When no language line has been specified for the attribute and it is + // also an implicit attribute we will display the raw attribute name + // and not modify it with any replacements before we display this. + if (isset($this->implicitAttributes[$primaryAttribute])) { + return $attribute; } - // If no language line has been specified for the attribute all of the - // underscores are removed from the attribute name and that will be - // used as default versions of the attribute's displayable names. return str_replace('_', ' ', Str::snake($attribute)); } + /** + * Get the primary attribute name. + * + * For example, if "name.0" is given, "name.*" will be returned. + * + * @param string $attribute + * @return string + */ + protected function getPrimaryAttribute($attribute) + { + foreach ($this->implicitAttributes as $unparsed => $parsed) { + if (in_array($attribute, $parsed)) { + return $unparsed; + } + } + + return $attribute; + } + /** * Get the displayable name of the value. * @@ -1795,7 +2233,7 @@ protected function replaceBetween($message, $attribute, $rule, $parameters) } /** - * Replace all place-holders for the digits rule. + * Replace all place-holders for the date_format rule. * * @param string $message * @param string $attribute @@ -1803,13 +2241,13 @@ protected function replaceBetween($message, $attribute, $rule, $parameters) * @param array $parameters * @return string */ - protected function replaceDigits($message, $attribute, $rule, $parameters) + protected function replaceDateFormat($message, $attribute, $rule, $parameters) { - return str_replace(':digits', $parameters[0], $message); + return str_replace(':format', $parameters[0], $message); } /** - * Replace all place-holders for the digits (between) rule. + * Replace all place-holders for the different rule. * * @param string $message * @param string $attribute @@ -1817,13 +2255,13 @@ protected function replaceDigits($message, $attribute, $rule, $parameters) * @param array $parameters * @return string */ - protected function replaceDigitsBetween($message, $attribute, $rule, $parameters) + protected function replaceDifferent($message, $attribute, $rule, $parameters) { - return $this->replaceBetween($message, $attribute, $rule, $parameters); + return $this->replaceSame($message, $attribute, $rule, $parameters); } /** - * Replace all place-holders for the size rule. + * Replace all place-holders for the digits rule. * * @param string $message * @param string $attribute @@ -1831,9 +2269,23 @@ protected function replaceDigitsBetween($message, $attribute, $rule, $parameters * @param array $parameters * @return string */ - protected function replaceSize($message, $attribute, $rule, $parameters) + protected function replaceDigits($message, $attribute, $rule, $parameters) { - return str_replace(':size', $parameters[0], $message); + return str_replace(':digits', $parameters[0], $message); + } + + /** + * Replace all place-holders for the digits (between) rule. + * + * @param string $message + * @param string $attribute + * @param string $rule + * @param array $parameters + * @return string + */ + protected function replaceDigitsBetween($message, $attribute, $rule, $parameters) + { + return $this->replaceBetween($message, $attribute, $rule, $parameters); } /** @@ -1896,6 +2348,20 @@ protected function replaceNotIn($message, $attribute, $rule, $parameters) return $this->replaceIn($message, $attribute, $rule, $parameters); } + /** + * Replace all place-holders for the in_array rule. + * + * @param string $message + * @param string $attribute + * @param string $rule + * @param array $parameters + * @return string + */ + protected function replaceInArray($message, $attribute, $rule, $parameters) + { + return str_replace(':other', $this->getAttribute($parameters[0]), $message); + } + /** * Replace all place-holders for the mimes rule. * @@ -1968,6 +2434,20 @@ protected function replaceRequiredWithoutAll($message, $attribute, $rule, $param return $this->replaceRequiredWith($message, $attribute, $rule, $parameters); } + /** + * Replace all place-holders for the size rule. + * + * @param string $message + * @param string $attribute + * @param string $rule + * @param array $parameters + * @return string + */ + protected function replaceSize($message, $attribute, $rule, $parameters) + { + return str_replace(':size', $parameters[0], $message); + } + /** * Replace all place-holders for the required_if rule. * @@ -2017,7 +2497,7 @@ protected function replaceSame($message, $attribute, $rule, $parameters) } /** - * Replace all place-holders for the different rule. + * Replace all place-holders for the before rule. * * @param string $message * @param string $attribute @@ -2025,13 +2505,17 @@ protected function replaceSame($message, $attribute, $rule, $parameters) * @param array $parameters * @return string */ - protected function replaceDifferent($message, $attribute, $rule, $parameters) + protected function replaceBefore($message, $attribute, $rule, $parameters) { - return $this->replaceSame($message, $attribute, $rule, $parameters); + if (! (strtotime($parameters[0]))) { + return str_replace(':date', $this->getAttribute($parameters[0]), $message); + } + + return str_replace(':date', $parameters[0], $message); } /** - * Replace all place-holders for the date_format rule. + * Replace all place-holders for the after rule. * * @param string $message * @param string $attribute @@ -2039,41 +2523,30 @@ protected function replaceDifferent($message, $attribute, $rule, $parameters) * @param array $parameters * @return string */ - protected function replaceDateFormat($message, $attribute, $rule, $parameters) + protected function replaceAfter($message, $attribute, $rule, $parameters) { - return str_replace(':format', $parameters[0], $message); + return $this->replaceBefore($message, $attribute, $rule, $parameters); } /** - * Replace all place-holders for the before rule. + * Get all attributes. * - * @param string $message - * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string + * @return array */ - protected function replaceBefore($message, $attribute, $rule, $parameters) + public function attributes() { - if (! (strtotime($parameters[0]))) { - return str_replace(':date', $this->getAttribute($parameters[0]), $message); - } - - return str_replace(':date', $parameters[0], $message); + return array_merge($this->data, $this->files); } /** - * Replace all place-holders for the after rule. + * Checks if an attribute exists. * - * @param string $message * @param string $attribute - * @param string $rule - * @param array $parameters - * @return string + * @return bool */ - protected function replaceAfter($message, $attribute, $rule, $parameters) + public function hasAttribute($attribute) { - return $this->replaceBefore($message, $attribute, $rule, $parameters); + return Arr::has($this->attributes(), $attribute); } /** @@ -2180,6 +2653,23 @@ protected function parseParameters($rule, $parameter) return str_getcsv($parameter); } + /** + * Parse named parameters to $key => $value items. + * + * @param array $parameters + * @return array + */ + protected function parseNamedParameters($parameters) + { + return array_reduce($parameters, function ($result, $item) { + list($key, $value) = array_pad(explode('=', $item, 2), 2, null); + + $result[$key] = $value; + + return $result; + }); + } + /** * Normalizes a rule so that we can accept short types. * @@ -2198,6 +2688,102 @@ protected function normalizeRule($rule) } } + /** + * Determine if the given rule depends on other fields. + * + * @param string $rule + * @return bool + */ + protected function dependsOnOtherFields($rule) + { + return in_array($rule, $this->dependentRules); + } + + /** + * Get the explicit keys from an attribute flattened with dot notation. + * + * E.g. 'foo.1.bar.spark.baz' -> [1, 'spark'] for 'foo.*.bar.*.baz' + * + * @param string $attribute + * @return array + */ + protected function getExplicitKeys($attribute) + { + $pattern = str_replace('\*', '([^\.]+)', preg_quote($this->getPrimaryAttribute($attribute))); + + if (preg_match('/^'.$pattern.'/', $attribute, $keys)) { + array_shift($keys); + + return $keys; + } + + return []; + } + + /** + * Get the explicit part of the attribute name. + * + * E.g. 'foo.bar.*.baz' -> 'foo.bar' + * + * Allows us to not spin through all of the flattened data for some operations. + * + * @param string $attribute + * @return string + */ + protected function getLeadingExplicitAttributePath($attribute) + { + return rtrim(explode('*', $attribute)[0], '.') ?: null; + } + + /** + * Extract data based on the given dot-notated path. + * + * Used to extract a sub-section of the data for faster iteration. + * + * @param string $attribute + * @return array + */ + protected function extractDataFromPath($attribute) + { + $results = []; + + $value = Arr::get($this->data, $attribute, '__missing__'); + + if ($value != '__missing__') { + Arr::set($results, $attribute, $value); + } + + return $results; + } + + /** + * Replace each field parameter which has asterisks with the given keys. + * + * @param array $parameters + * @param array $keys + * @return array + */ + protected function replaceAsterisksInParameters(array $parameters, array $keys) + { + return array_map(function ($field) use ($keys) { + return $this->replaceAsterisksWithKeys($field, $keys); + }, $parameters); + } + + /** + * Replace asterisks with explicit keys. + * + * E.g. 'foo.*.bar.*.baz', [1, 'spark'] -> foo.1.bar.spark.baz + * + * @param string $field + * @param array $keys + * @return string + */ + protected function replaceAsterisksWithKeys($field, array $keys) + { + return vsprintf(str_replace('*', '%s', $field), $keys); + } + /** * Get the array of custom validator extensions. * @@ -2319,11 +2905,15 @@ public function getData() * Set the data under validation. * * @param array $data - * @return void + * @return $this */ public function setData(array $data) { $this->data = $this->parseData($data); + + $this->setRules($this->initialRules); + + return $this; } /** @@ -2344,7 +2934,13 @@ public function getRules() */ public function setRules(array $rules) { - $this->rules = $this->explodeRules($rules); + $this->initialRules = $rules; + + $this->rules = []; + + $rules = $this->explodeRules($this->initialRules); + + $this->rules = array_merge($this->rules, $rules); return $this; } @@ -2616,7 +3212,11 @@ protected function callExtension($rule, $parameters) */ protected function callClassBasedExtension($callback, $parameters) { - list($class, $method) = explode('@', $callback); + if (Str::contains($callback, '@')) { + list($class, $method) = explode('@', $callback); + } else { + list($class, $method) = [$callback, 'validate']; + } return call_user_func_array([$this->container->make($class), $method], $parameters); } @@ -2665,6 +3265,7 @@ protected function callClassBasedReplacer($callback, $message, $attribute, $rule * @param array $parameters * @param string $rule * @return void + * * @throws \InvalidArgumentException */ protected function requireParameterCount($count, $parameters, $rule) diff --git a/application/vendor/laravel/framework/src/Illuminate/Validation/composer.json b/application/vendor/laravel/framework/src/Illuminate/Validation/composer.json old mode 100644 new mode 100755 index 3733144..057aa96 --- a/application/vendor/laravel/framework/src/Illuminate/Validation/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/Validation/composer.json @@ -10,16 +10,16 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/container": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/http-foundation": "2.7.*", - "symfony/translation": "2.7.*" + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/http-foundation": "2.8.*|3.0.*", + "symfony/translation": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -28,11 +28,11 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "suggest": { - "illuminate/database": "Required to use the database presence verifier (5.1.*)." + "illuminate/database": "Required to use the database presence verifier (5.2.*)." }, "minimum-stability": "dev" } diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php b/application/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php index c257a82..6156d45 100644 --- a/application/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php @@ -77,6 +77,20 @@ class BladeCompiler extends Compiler implements CompilerInterface */ protected $footer = []; + /** + * Placeholder to temporary mark the position of verbatim blocks. + * + * @var string + */ + protected $verbatimPlaceholder = '@__verbatim__@'; + + /** + * Array to temporary store the verbatim blocks found in the template. + * + * @var array + */ + protected $verbatimBlocks = []; + /** * Counter to keep track of nested forelse statements. * @@ -96,9 +110,9 @@ public function compile($path = null) $this->setPath($path); } - $contents = $this->compileString($this->files->get($this->getPath())); - if (! is_null($this->cachePath)) { + $contents = $this->compileString($this->files->get($this->getPath())); + $this->files->put($this->getCompiledPath($this->getPath()), $contents); } } @@ -134,6 +148,10 @@ public function compileString($value) { $result = ''; + if (strpos($value, '@verbatim') !== false) { + $value = $this->storeVerbatimBlocks($value); + } + $this->footer = []; // Here we will loop through all of the tokens returned by the Zend lexer and @@ -143,6 +161,10 @@ public function compileString($value) $result .= is_array($token) ? $this->parseToken($token) : $token; } + if (! empty($this->verbatimBlocks)) { + $result = $this->restoreVerbatimBlocks($result); + } + // If there are any footer lines that need to get added to a template we will // add them here at the end of the template. This gets used mainly for the // template inheritance via the extends keyword that should be appended. @@ -154,6 +176,38 @@ public function compileString($value) return $result; } + /** + * Store the verbatim blocks and replace them with a temporary placeholder. + * + * @param string $value + * @return string + */ + protected function storeVerbatimBlocks($value) + { + return preg_replace_callback('/(?verbatimBlocks[] = $matches[1]; + + return $this->verbatimPlaceholder; + }, $value); + } + + /** + * Replace the raw placeholders with the original code stored in the raw blocks. + * + * @param string $result + * @return string + */ + protected function restoreVerbatimBlocks($result) + { + $result = preg_replace_callback('/'.preg_quote($this->verbatimPlaceholder).'/', function () { + return array_shift($this->verbatimBlocks); + }, $result); + + $this->verbatimBlocks = []; + + return $result; + } + /** * Parse the tokens from the template. * @@ -266,16 +320,18 @@ protected function getEchoMethods() protected function compileStatements($value) { $callback = function ($match) { - if (method_exists($this, $method = 'compile'.ucfirst($match[1]))) { - $match[0] = $this->$method(Arr::get($match, 3)); + if (Str::contains($match[1], '@')) { + $match[0] = isset($match[3]) ? $match[1].$match[3] : $match[1]; } elseif (isset($this->customDirectives[$match[1]])) { $match[0] = call_user_func($this->customDirectives[$match[1]], Arr::get($match, 3)); + } elseif (method_exists($this, $method = 'compile'.ucfirst($match[1]))) { + $match[0] = $this->$method(Arr::get($match, 3)); } return isset($match[3]) ? $match[0] : $match[0].$match[2]; }; - return preg_replace_callback('/\B@(\w+)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', $callback, $value); + return preg_replace_callback('/\B@(@?\w+(?:::\w+)?)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', $callback, $value); } /** @@ -526,6 +582,28 @@ protected function compileForeach($expression) return ""; } + /** + * Compile the break statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileBreak($expression) + { + return $expression ? "" : ''; + } + + /** + * Compile the continue statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileContinue($expression) + { + return $expression ? "" : ''; + } + /** * Compile the forelse statements into valid PHP. * @@ -550,6 +628,17 @@ protected function compileCan($expression) return "check{$expression}): ?>"; } + /** + * Compile the else-can statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileElsecan($expression) + { + return "check{$expression}): ?>"; + } + /** * Compile the cannot statements into valid PHP. * @@ -561,6 +650,17 @@ protected function compileCannot($expression) return "denies{$expression}): ?>"; } + /** + * Compile the else-can statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileElsecannot($expression) + { + return "denies{$expression}): ?>"; + } + /** * Compile the if statements into valid PHP. * @@ -596,6 +696,17 @@ protected function compileEmpty($expression) return ""; } + /** + * Compile the has section statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileHasSection($expression) + { + return "yieldContent{$expression}))): ?>"; + } + /** * Compile the while statements into valid PHP. * @@ -684,6 +795,39 @@ protected function compileEndforelse($expression) return ''; } + /** + * Compile the raw PHP statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compilePhp($expression) + { + return $expression ? "" : ''; + } + + /** + * Compile the unset statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileUnset($expression) + { + return ""; + } + /** * Compile the extends statements into valid PHP. * @@ -692,9 +836,7 @@ protected function compileEndforelse($expression) */ protected function compileExtends($expression) { - if (Str::startsWith($expression, '(')) { - $expression = substr($expression, 1, -1); - } + $expression = $this->stripParentheses($expression); $data = "make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>"; @@ -711,13 +853,24 @@ protected function compileExtends($expression) */ protected function compileInclude($expression) { - if (Str::startsWith($expression, '(')) { - $expression = substr($expression, 1, -1); - } + $expression = $this->stripParentheses($expression); return "make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>"; } + /** + * Compile the include statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compileIncludeIf($expression) + { + $expression = $this->stripParentheses($expression); + + return "exists($expression)) echo \$__env->make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>"; + } + /** * Compile the stack statements into the content. * @@ -726,7 +879,7 @@ protected function compileInclude($expression) */ protected function compileStack($expression) { - return "yieldContent{$expression}; ?>"; + return "yieldPushContent{$expression}; ?>"; } /** @@ -737,7 +890,7 @@ protected function compileStack($expression) */ protected function compilePush($expression) { - return "startSection{$expression}; ?>"; + return "startPush{$expression}; ?>"; } /** @@ -748,7 +901,22 @@ protected function compilePush($expression) */ protected function compileEndpush($expression) { - return 'appendSection(); ?>'; + return 'stopPush(); ?>'; + } + + /** + * Strip the parentheses from the given expression. + * + * @param string $expression + * @return string + */ + protected function stripParentheses($expression) + { + if (Str::startsWith($expression, '(')) { + $expression = substr($expression, 1, -1); + } + + return $expression; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php b/application/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php old mode 100644 new mode 100755 index 73ded29..91f28c5 --- a/application/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php @@ -48,7 +48,7 @@ public function __construct(Filesystem $files, $cachePath) */ public function getCompiledPath($path) { - return $this->cachePath.'/'.md5($path); + return $this->cachePath.'/'.sha1($path).'.php'; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Compilers/CompilerInterface.php b/application/vendor/laravel/framework/src/Illuminate/View/Compilers/CompilerInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php b/application/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php old mode 100644 new mode 100755 index 6f50bc0..c71cdab --- a/application/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php @@ -2,6 +2,7 @@ namespace Illuminate\View\Engines; +use Exception; use ErrorException; use Illuminate\View\Compilers\CompilerInterface; @@ -71,7 +72,7 @@ public function get($path, array $data = []) * * @throws $e */ - protected function handleViewException($e, $obLevel) + protected function handleViewException(Exception $e, $obLevel) { $e = new ErrorException($this->getMessage($e), 0, 1, $e->getFile(), $e->getLine(), $e); @@ -84,7 +85,7 @@ protected function handleViewException($e, $obLevel) * @param \Exception $e * @return string */ - protected function getMessage($e) + protected function getMessage(Exception $e) { return $e->getMessage().' (View: '.realpath(last($this->lastCompiled)).')'; } diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Engines/Engine.php b/application/vendor/laravel/framework/src/Illuminate/View/Engines/Engine.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Engines/EngineInterface.php b/application/vendor/laravel/framework/src/Illuminate/View/Engines/EngineInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Engines/EngineResolver.php b/application/vendor/laravel/framework/src/Illuminate/View/Engines/EngineResolver.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php b/application/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php old mode 100644 new mode 100755 index 7bbf3fc..afe4e56 --- a/application/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php @@ -58,7 +58,7 @@ protected function evaluatePath($__path, $__data) * * @throws $e */ - protected function handleViewException($e, $obLevel) + protected function handleViewException(Exception $e, $obLevel) { while (ob_get_level() > $obLevel) { ob_end_clean(); diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Expression.php b/application/vendor/laravel/framework/src/Illuminate/View/Expression.php index 4749b23..1d34699 100644 --- a/application/vendor/laravel/framework/src/Illuminate/View/Expression.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Expression.php @@ -2,45 +2,11 @@ namespace Illuminate\View; -use Illuminate\Contracts\Support\Htmlable; +use Illuminate\Support\HtmlString; -class Expression implements Htmlable +/** + * @deprecated since version 5.2. Use Illuminate\Support\HtmlString. + */ +class Expression extends HtmlString { - /** - * The HTML string. - * - * @var string - */ - protected $html; - - /** - * Create a new HTML string instance. - * - * @param string $html - * @return void - */ - public function __construct($html) - { - $this->html = $html; - } - - /** - * Get the the HTML string. - * - * @return string - */ - public function toHtml() - { - return $this->html; - } - - /** - * Get the the HTML string. - * - * @return string - */ - public function __toString() - { - return $this->toHtml(); - } } diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Factory.php b/application/vendor/laravel/framework/src/Illuminate/View/Factory.php old mode 100644 new mode 100755 index 5c7e7b5..af91335 --- a/application/vendor/laravel/framework/src/Illuminate/View/Factory.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Factory.php @@ -6,9 +6,9 @@ use Illuminate\Support\Arr; use Illuminate\Support\Str; use InvalidArgumentException; -use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Support\Arrayable; use Illuminate\View\Engines\EngineResolver; +use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\View\Factory as FactoryContract; @@ -91,6 +91,20 @@ class Factory implements FactoryContract */ protected $sectionStack = []; + /** + * All of the finished, captured push sections. + * + * @var array + */ + protected $pushes = []; + + /** + * The stack of in-progress push sections. + * + * @var array + */ + protected $pushStack = []; + /** * The number of active rendering operations. * @@ -636,6 +650,78 @@ public function yieldContent($section, $default = '') ); } + /** + * Start injecting content into a push section. + * + * @param string $section + * @param string $content + * @return void + */ + public function startPush($section, $content = '') + { + if ($content === '') { + if (ob_start()) { + $this->pushStack[] = $section; + } + } else { + $this->extendPush($section, $content); + } + } + + /** + * Stop injecting content into a push section. + * + * @return string + * @throws \InvalidArgumentException + */ + public function stopPush() + { + if (empty($this->pushStack)) { + throw new InvalidArgumentException('Cannot end a section without first starting one.'); + } + + $last = array_pop($this->pushStack); + + $this->extendPush($last, ob_get_clean()); + + return $last; + } + + /** + * Append content to a given push section. + * + * @param string $section + * @param string $content + * @return void + */ + protected function extendPush($section, $content) + { + if (! isset($this->pushes[$section])) { + $this->pushes[$section] = []; + } + if (! isset($this->pushes[$section][$this->renderCount])) { + $this->pushes[$section][$this->renderCount] = $content; + } else { + $this->pushes[$section][$this->renderCount] .= $content; + } + } + + /** + * Get the string contents of a push section. + * + * @param string $section + * @param string $default + * @return string + */ + public function yieldPushContent($section, $default = '') + { + if (! isset($this->pushes[$section])) { + return $default; + } + + return implode(array_reverse($this->pushes[$section])); + } + /** * Flush all of the section contents. * @@ -646,8 +732,10 @@ public function flushSections() $this->renderCount = 0; $this->sections = []; - $this->sectionStack = []; + + $this->pushes = []; + $this->pushStack = []; } /** diff --git a/application/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php b/application/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php b/application/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php index 812cf61..618b7dd 100644 --- a/application/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php @@ -39,7 +39,7 @@ public function handle($request, Closure $next) // its value with all view instances so the views can easily access errors // without having to bind. An empty bag is set when there aren't errors. $this->view->share( - 'errors', $request->session()->get('errors', new ViewErrorBag) + 'errors', $request->session()->get('errors') ?: new ViewErrorBag ); // Putting the errors in the view for every view allows the developer to just diff --git a/application/vendor/laravel/framework/src/Illuminate/View/View.php b/application/vendor/laravel/framework/src/Illuminate/View/View.php old mode 100644 new mode 100755 index c748ce4..09cd8e1 --- a/application/vendor/laravel/framework/src/Illuminate/View/View.php +++ b/application/vendor/laravel/framework/src/Illuminate/View/View.php @@ -9,8 +9,8 @@ use Illuminate\Support\Str; use Illuminate\Support\MessageBag; use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Contracts\Support\Renderable; use Illuminate\View\Engines\EngineInterface; +use Illuminate\Contracts\Support\Renderable; use Illuminate\Contracts\Support\MessageProvider; use Illuminate\Contracts\View\View as ViewContract; @@ -58,7 +58,7 @@ class View implements ArrayAccess, ViewContract * @param \Illuminate\View\Engines\EngineInterface $engine * @param string $view * @param string $path - * @param array $data + * @param mixed $data * @return void */ public function __construct(Factory $factory, EngineInterface $engine, $view, $path, $data = []) @@ -76,6 +76,8 @@ public function __construct(Factory $factory, EngineInterface $engine, $view, $p * * @param callable|null $callback * @return string + * + * @throws \Throwable */ public function render(callable $callback = null) { diff --git a/application/vendor/laravel/framework/src/Illuminate/View/ViewFinderInterface.php b/application/vendor/laravel/framework/src/Illuminate/View/ViewFinderInterface.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php b/application/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php old mode 100644 new mode 100755 diff --git a/application/vendor/laravel/framework/src/Illuminate/View/composer.json b/application/vendor/laravel/framework/src/Illuminate/View/composer.json index 4eb012b..a05e196 100644 --- a/application/vendor/laravel/framework/src/Illuminate/View/composer.json +++ b/application/vendor/laravel/framework/src/Illuminate/View/composer.json @@ -10,17 +10,17 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "email": "taylor@laravel.com" } ], "require": { "php": ">=5.5.9", - "illuminate/container": "5.1.*", - "illuminate/contracts": "5.1.*", - "illuminate/events": "5.1.*", - "illuminate/filesystem": "5.1.*", - "illuminate/support": "5.1.*", - "symfony/debug": "2.7.*" + "illuminate/container": "5.2.*", + "illuminate/contracts": "5.2.*", + "illuminate/events": "5.2.*", + "illuminate/filesystem": "5.2.*", + "illuminate/support": "5.2.*", + "symfony/debug": "2.8.*|3.0.*" }, "autoload": { "psr-4": { @@ -29,7 +29,7 @@ }, "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" } }, "minimum-stability": "dev" diff --git a/application/vendor/laravelcollective/html/CONTRIBUTING.md b/application/vendor/laravelcollective/html/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/application/vendor/laravelcollective/html/composer.json b/application/vendor/laravelcollective/html/composer.json old mode 100644 new mode 100755 index 8d70bd5..e8461cf --- a/application/vendor/laravelcollective/html/composer.json +++ b/application/vendor/laravelcollective/html/composer.json @@ -1,6 +1,12 @@ { "name": "laravelcollective/html", + "description": "HTML and Form Builders for the Laravel Framework", "license": "MIT", + "homepage": "http://laravelcollective.com", + "support": { + "issues": "https://github.com/LaravelCollective/html/issues", + "source": "https://github.com/LaravelCollective/html" + }, "authors": [ { "name": "Adam Engebretson", @@ -13,12 +19,14 @@ ], "require": { "php": ">=5.5.9", - "illuminate/http": "5.1.*", - "illuminate/routing": "5.1.*", - "illuminate/session": "5.1.*", - "illuminate/support": "5.1.*" + "illuminate/http": "5.2.*", + "illuminate/routing": "5.2.*", + "illuminate/session": "5.2.*", + "illuminate/support": "5.2.*", + "illuminate/view": "5.2.*" }, "require-dev": { + "illuminate/database": "5.2.*", "mockery/mockery": "~0.9", "phpunit/phpunit": "~4.0" }, diff --git a/application/vendor/laravelcollective/html/src/Componentable.php b/application/vendor/laravelcollective/html/src/Componentable.php new file mode 100644 index 0000000..a0a364b --- /dev/null +++ b/application/vendor/laravelcollective/html/src/Componentable.php @@ -0,0 +1,110 @@ +getComponentData($component['signature'], $arguments); + + return new HtmlString( + $this->view->make($component['view'], $data)->render() + ); + } + + /** + * Prepare the component data, while respecting provided defaults. + * + * @param array $signature + * @param array $arguments + * + * @return array + */ + protected function getComponentData(array $signature, array $arguments) + { + $data = []; + + $i = 0; + foreach ($signature as $variable => $default) { + // If the "variable" value is actually a numeric key, we can assume that + // no default had been specified for the component argument and we'll + // just use null instead, so that we can treat them all the same. + if (is_numeric($variable)) { + $variable = $default; + $default = null; + } + + $data[$variable] = array_get($arguments, $i, $default); + + $i++; + } + + return $data; + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * + * @return \Illuminate\Contracts\View\View|mixed + * + * @throws \BadMethodCallException + */ + public function __call($method, $parameters) + { + if (static::hasComponent($method)) { + return $this->renderComponent($method, $parameters); + } + + throw new BadMethodCallException("Method {$method} does not exist."); + } +} diff --git a/application/vendor/laravelcollective/html/src/Eloquent/FormAccessible.php b/application/vendor/laravelcollective/html/src/Eloquent/FormAccessible.php new file mode 100644 index 0000000..5a42608 --- /dev/null +++ b/application/vendor/laravelcollective/html/src/Eloquent/FormAccessible.php @@ -0,0 +1,88 @@ +getAttributeFromArray($key); + + // If the attribute is listed as a date, we will convert it to a DateTime + // instance on retrieval, which makes it quite convenient to work with + // date fields without having to create a mutator for each property. + if (in_array($key, $this->getDates())) { + if (! is_null($value)) { + $value = $this->asDateTime($value); + } + } + + // If the attribute has a get mutator, we will call that then return what + // it returns as the value, which is useful for transforming values on + // retrieval from the model to a form that is more useful for usage. + if ($this->hasFormMutator($key)) { + return $this->mutateFormAttribute($key, $value); + } + + // No form mutator, let the model resolve this + return data_get($this, $key); + } + + /** + * @param $key + * + * @return bool + */ + protected function hasFormMutator($key) + { + $methods = $this->getReflection()->getMethods(ReflectionMethod::IS_PUBLIC); + + $mutator = collect($methods) + ->first(function ($index, ReflectionMethod $method) use ($key) { + return $method->getName() == 'form' . Str::studly($key) . 'Attribute'; + }); + + return (bool) $mutator; + } + + /** + * @param $key + * @param $value + * + * @return mixed + */ + private function mutateFormAttribute($key, $value) + { + return $this->{'form' . Str::studly($key) . 'Attribute'}($value); + } + + /** + * Get a ReflectionClass Instance + * @return ReflectionClass + */ + protected function getReflection() + { + if (! $this->reflection) { + $this->reflection = new ReflectionClass($this); + } + + return $this->reflection; + } +} diff --git a/application/vendor/laravelcollective/html/src/FormBuilder.php b/application/vendor/laravelcollective/html/src/FormBuilder.php index 74d77de..d345b01 100644 --- a/application/vendor/laravelcollective/html/src/FormBuilder.php +++ b/application/vendor/laravelcollective/html/src/FormBuilder.php @@ -3,14 +3,21 @@ namespace Collective\Html; use DateTime; -use Illuminate\Contracts\Routing\UrlGenerator; -use Illuminate\Session\SessionInterface; +use BadMethodCallException; +use Illuminate\Http\Request; use Illuminate\Support\Collection; +use Illuminate\Support\HtmlString; +use Illuminate\Contracts\View\Factory; +use Illuminate\Session\SessionInterface; use Illuminate\Support\Traits\Macroable; +use Illuminate\Contracts\Routing\UrlGenerator; class FormBuilder { - use Macroable; + use Macroable, Componentable { + Macroable::__call as macroCall; + Componentable::__call as componentCall; + } /** * The HTML builder instance. @@ -26,6 +33,13 @@ class FormBuilder */ protected $url; + /** + * The View factory instance. + * + * @var \Illuminate\Contracts\View\Factory + */ + protected $view; + /** * The CSRF token used by the form builder. * @@ -54,6 +68,8 @@ class FormBuilder */ protected $labels = []; + protected $request; + /** * The reserved form open attributes. * @@ -78,17 +94,18 @@ class FormBuilder /** * Create a new form builder instance. * + * @param \Collective\Html\HtmlBuilder $html * @param \Illuminate\Contracts\Routing\UrlGenerator $url - * @param \Collective\Html\HtmlBuilder $html - * @param string $csrfToken - * - * @return void + * @param \Illuminate\Contracts\View\Factory $view + * @param string $csrfToken */ - public function __construct(HtmlBuilder $html, UrlGenerator $url, $csrfToken) + public function __construct(HtmlBuilder $html, UrlGenerator $url, Factory $view, $csrfToken, Request $request = null) { $this->url = $url; $this->html = $html; + $this->view = $view; $this->csrfToken = $csrfToken; + $this->request = $request; } /** @@ -96,7 +113,7 @@ public function __construct(HtmlBuilder $html, UrlGenerator $url, $csrfToken) * * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function open(array $options = []) { @@ -125,16 +142,16 @@ public function open(array $options = []) // is used to spoof requests for this PUT, PATCH, etc. methods on forms. $attributes = array_merge( - $attributes, array_except($options, $this->reserved) + $attributes, array_except($options, $this->reserved) - ); + ); // Finally, we will concatenate all of the attributes into a single string so // we can build out the final form open statement. We'll also append on an // extra value for the hidden _method field if it's needed for the form. $attributes = $this->html->attributes($attributes); - return ''.$append; + return $this->toHtmlString('' . $append); } /** @@ -143,7 +160,7 @@ public function open(array $options = []) * @param mixed $model * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function model($model, array $options = []) { @@ -175,7 +192,7 @@ public function close() $this->model = null; - return ''; + return $this->toHtmlString(''); } /** @@ -185,7 +202,7 @@ public function close() */ public function token() { - $token = !empty($this->csrfToken) ? $this->csrfToken : $this->session->getToken(); + $token = ! empty($this->csrfToken) ? $this->csrfToken : $this->session->getToken(); return $this->hidden('_token', $token); } @@ -196,18 +213,23 @@ public function token() * @param string $name * @param string $value * @param array $options + * @param bool $escape_html * - * @return string + * @return \Illuminate\Support\HtmlString */ - public function label($name, $value = null, $options = []) + public function label($name, $value = null, $options = [], $escape_html = true) { $this->labels[] = $name; $options = $this->html->attributes($options); - $value = e($this->formatLabel($name, $value)); + $value = $this->formatLabel($name, $value); + + if ($escape_html) { + $value = $this->html->entities($value); + } - return ''; + return $this->toHtmlString(''); } /** @@ -231,11 +253,11 @@ protected function formatLabel($name, $value) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function input($type, $name, $value = null, $options = []) { - if (!isset($options['name'])) { + if (! isset($options['name'])) { $options['name'] = $name; } @@ -244,7 +266,7 @@ public function input($type, $name, $value = null, $options = []) // in the model instance if one is set. Otherwise we will just use empty. $id = $this->getIdAttribute($name, $options); - if (!in_array($type, $this->skipValueTypes)) { + if (! in_array($type, $this->skipValueTypes)) { $value = $this->getValueAttribute($name, $value); } @@ -255,7 +277,7 @@ public function input($type, $name, $value = null, $options = []) $options = array_merge($options, $merge); - return 'html->attributes($options).'>'; + return $this->toHtmlString('html->attributes($options) . '>'); } /** @@ -265,7 +287,7 @@ public function input($type, $name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function text($name, $value = null, $options = []) { @@ -278,7 +300,7 @@ public function text($name, $value = null, $options = []) * @param string $name * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function password($name, $options = []) { @@ -292,7 +314,7 @@ public function password($name, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function hidden($name, $value = null, $options = []) { @@ -306,7 +328,7 @@ public function hidden($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function email($name, $value = null, $options = []) { @@ -320,7 +342,7 @@ public function email($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function tel($name, $value = null, $options = []) { @@ -334,7 +356,7 @@ public function tel($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function number($name, $value = null, $options = []) { @@ -348,7 +370,7 @@ public function number($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function date($name, $value = null, $options = []) { @@ -366,7 +388,7 @@ public function date($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function datetime($name, $value = null, $options = []) { @@ -384,7 +406,7 @@ public function datetime($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function datetimeLocal($name, $value = null, $options = []) { @@ -402,7 +424,7 @@ public function datetimeLocal($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function time($name, $value = null, $options = []) { @@ -416,7 +438,7 @@ public function time($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function url($name, $value = null, $options = []) { @@ -429,7 +451,7 @@ public function url($name, $value = null, $options = []) * @param string $name * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function file($name, $options = []) { @@ -443,11 +465,11 @@ public function file($name, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function textarea($name, $value = null, $options = []) { - if (!isset($options['name'])) { + if (! isset($options['name'])) { $options['name'] = $name; } @@ -467,7 +489,7 @@ public function textarea($name, $value = null, $options = []) // the element. Then we'll create the final textarea elements HTML for us. $options = $this->html->attributes($options); - return ''.e($value).''; + return $this->toHtmlString('' . e($value) . ''); } /** @@ -515,7 +537,7 @@ protected function setQuickTextAreaSize($options) * @param string $selected * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function select($name, $list = [], $selected = null, $options = []) { @@ -526,7 +548,7 @@ public function select($name, $list = [], $selected = null, $options = []) $options['id'] = $this->getIdAttribute($name, $options); - if (!isset($options['name'])) { + if (! isset($options['name'])) { $options['name'] = $name; } @@ -551,7 +573,7 @@ public function select($name, $list = [], $selected = null, $options = []) $list = implode('', $html); - return "{$list}"; + return $this->toHtmlString("{$list}"); } /** @@ -563,7 +585,7 @@ public function select($name, $list = [], $selected = null, $options = []) * @param string $selected * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function selectRange($name, $begin, $end, $selected = null, $options = []) { @@ -581,7 +603,7 @@ public function selectRange($name, $begin, $end, $selected = null, $options = [] * @param string $selected * @param array $options * - * @return string + * @return mixed */ public function selectYear() { @@ -596,7 +618,7 @@ public function selectYear() * @param array $options * @param string $format * - * @return string + * @return \Illuminate\Support\HtmlString */ public function selectMonth($name, $selected = null, $options = [], $format = '%B') { @@ -616,7 +638,7 @@ public function selectMonth($name, $selected = null, $options = [], $format = '% * @param string $value * @param string $selected * - * @return string + * @return \Illuminate\Support\HtmlString */ public function getSelectOption($display, $value, $selected) { @@ -634,7 +656,7 @@ public function getSelectOption($display, $value, $selected) * @param string $label * @param string $selected * - * @return string + * @return \Illuminate\Support\HtmlString */ protected function optionGroup($list, $label, $selected) { @@ -644,7 +666,7 @@ protected function optionGroup($list, $label, $selected) $html[] = $this->option($display, $value, $selected); } - return ''.implode('', $html).''; + return $this->toHtmlString('' . implode('', $html) . ''); } /** @@ -654,7 +676,7 @@ protected function optionGroup($list, $label, $selected) * @param string $value * @param string $selected * - * @return string + * @return \Illuminate\Support\HtmlString */ protected function option($display, $value, $selected) { @@ -662,7 +684,7 @@ protected function option($display, $value, $selected) $options = ['value' => $value, 'selected' => $selected]; - return 'html->attributes($options).'>'.e($display).''; + return $this->toHtmlString('html->attributes($options) . '>' . e($display) . ''); } /** @@ -671,7 +693,7 @@ protected function option($display, $value, $selected) * @param $display * @param $selected * - * @return string + * @return \Illuminate\Support\HtmlString */ protected function placeholderOption($display, $selected) { @@ -680,7 +702,7 @@ protected function placeholderOption($display, $selected) $options = compact('selected'); $options['value'] = ''; - return 'html->attributes($options).'>'.e($display).''; + return $this->toHtmlString('html->attributes($options) . '>' . e($display) . ''); } /** @@ -689,14 +711,12 @@ protected function placeholderOption($display, $selected) * @param string $value * @param string $selected * - * @return string|null + * @return null|string */ protected function getSelectedValue($value, $selected) { if (is_array($selected)) { - return in_array($value, $selected, true) || in_array((string) $value, $selected, true) - ? 'selected' - : null; + return in_array($value, $selected, true) ? 'selected' : null; } return ((string) $value == (string) $selected) ? 'selected' : null; @@ -710,7 +730,7 @@ protected function getSelectedValue($value, $selected) * @param bool $checked * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function checkbox($name, $value = 1, $checked = null, $options = []) { @@ -725,7 +745,7 @@ public function checkbox($name, $value = 1, $checked = null, $options = []) * @param bool $checked * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function radio($name, $value = null, $checked = null, $options = []) { @@ -745,7 +765,7 @@ public function radio($name, $value = null, $checked = null, $options = []) * @param bool $checked * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ protected function checkable($type, $name, $value, $checked, $options) { @@ -771,15 +791,15 @@ protected function checkable($type, $name, $value, $checked, $options) protected function getCheckedState($type, $name, $value, $checked) { switch ($type) { - case 'checkbox': - return $this->getCheckboxCheckedState($name, $value, $checked); + case 'checkbox': + return $this->getCheckboxCheckedState($name, $value, $checked); - case 'radio': - return $this->getRadioCheckedState($name, $value, $checked); + case 'radio': + return $this->getRadioCheckedState($name, $value, $checked); - default: - return $this->getValueAttribute($name) == $value; - } + default: + return $this->getValueAttribute($name) == $value; + } } /** @@ -793,11 +813,13 @@ protected function getCheckedState($type, $name, $value, $checked) */ protected function getCheckboxCheckedState($name, $value, $checked) { - if (isset($this->session) && !$this->oldInputIsEmpty() && is_null($this->old($name))) { + $request = $this->request($name); + + if (isset($this->session) && ! $this->oldInputIsEmpty() && is_null($this->old($name)) && !$request) { return false; } - if ($this->missingOldAndModel($name)) { + if ($this->missingOldAndModel($name) && !$request) { return $checked; } @@ -823,7 +845,9 @@ protected function getCheckboxCheckedState($name, $value, $checked) */ protected function getRadioCheckedState($name, $value, $checked) { - if ($this->missingOldAndModel($name)) { + $request = $this->request($name); + + if ($this->missingOldAndModel($name) && !$request) { return $checked; } @@ -848,7 +872,7 @@ protected function missingOldAndModel($name) * @param string $value * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function reset($value, $attributes = []) { @@ -862,7 +886,7 @@ public function reset($value, $attributes = []) * @param string $name * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function image($url, $name = null, $attributes = []) { @@ -878,7 +902,7 @@ public function image($url, $name = null, $attributes = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function color($name, $value = null, $options = []) { @@ -891,7 +915,7 @@ public function color($name, $value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function submit($value = null, $options = []) { @@ -904,15 +928,15 @@ public function submit($value = null, $options = []) * @param string $value * @param array $options * - * @return string + * @return \Illuminate\Support\HtmlString */ public function button($value = null, $options = []) { - if (!array_key_exists('type', $options)) { + if (! array_key_exists('type', $options)) { $options['type'] = 'button'; } - return 'html->attributes($options).'>'.$value.''; + return $this->toHtmlString('html->attributes($options) . '>' . $value . ''); } /** @@ -1068,11 +1092,16 @@ public function getValueAttribute($name, $value = null) return $value; } - if (!is_null($this->old($name))) { + if (! is_null($this->old($name)) && $name != '_method') { return $this->old($name); } - if (!is_null($value)) { + $request = $this->request($name); + if (!is_null($request)) { + return $request; + } + + if (! is_null($value)) { return $value; } @@ -1081,6 +1110,20 @@ public function getValueAttribute($name, $value = null) } } + /** + * Get value from current Request + * @param $name + * @return array|null|string + */ + protected function request($name) + { + if (!isset($this->request)) { + return null; + } + + return $this->request->input($this->transformKey($name)); + } + /** * Get the model value that should be assigned to the field. * @@ -1090,6 +1133,10 @@ public function getValueAttribute($name, $value = null) */ protected function getModelValueAttribute($name) { + if (method_exists($this->model, 'getFormValue')) { + return $this->model->getFormValue($this->transformKey($name)); + } + return data_get($this->model, $this->transformKey($name)); } @@ -1122,13 +1169,25 @@ public function oldInputIsEmpty() * * @param string $key * - * @return string + * @return mixed */ protected function transformKey($key) { return str_replace(['.', '[]', '[', ']'], ['_', '', '.', ''], $key); } + /** + * Transform the string to an Html serializable object + * + * @param $html + * + * @return \Illuminate\Support\HtmlString + */ + protected function toHtmlString($html) + { + return new HtmlString($html); + } + /** * Get the session store implementation. * @@ -1152,4 +1211,27 @@ public function setSessionStore(SessionInterface $session) return $this; } + + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * + * @return \Illuminate\Contracts\View\View|mixed + * + * @throws \BadMethodCallException + */ + public function __call($method, $parameters) + { + if (static::hasComponent($method)) { + return $this->componentCall($method, $parameters); + } + + if (static::hasMacro($method)) { + return $this->macroCall($method, $parameters); + } + + throw new BadMethodCallException("Method {$method} does not exist."); + } } diff --git a/application/vendor/laravelcollective/html/src/FormFacade.php b/application/vendor/laravelcollective/html/src/FormFacade.php index 66d459f..24d2610 100644 --- a/application/vendor/laravelcollective/html/src/FormFacade.php +++ b/application/vendor/laravelcollective/html/src/FormFacade.php @@ -9,6 +9,7 @@ */ class FormFacade extends Facade { + /** * Get the registered name of the component. * diff --git a/application/vendor/laravelcollective/html/src/HtmlBuilder.php b/application/vendor/laravelcollective/html/src/HtmlBuilder.php old mode 100644 new mode 100755 index 7c4de59..64fe67d --- a/application/vendor/laravelcollective/html/src/HtmlBuilder.php +++ b/application/vendor/laravelcollective/html/src/HtmlBuilder.php @@ -2,12 +2,18 @@ namespace Collective\Html; -use Illuminate\Contracts\Routing\UrlGenerator; +use BadMethodCallException; +use Illuminate\Support\HtmlString; +use Illuminate\Contracts\View\Factory; use Illuminate\Support\Traits\Macroable; +use Illuminate\Contracts\Routing\UrlGenerator; class HtmlBuilder { - use Macroable; + use Macroable, Componentable { + Macroable::__call as macroCall; + Componentable::__call as componentCall; + } /** * The URL generator instance. @@ -16,16 +22,23 @@ class HtmlBuilder */ protected $url; + /** + * The View Factory instance. + * + * @var \Illuminate\Contracts\View\Factory + */ + protected $view; + /** * Create a new HTML builder instance. * * @param \Illuminate\Contracts\Routing\UrlGenerator $url - * - * @return void + * @param \Illuminate\Contracts\View\Factory $view */ - public function __construct(UrlGenerator $url = null) + public function __construct(UrlGenerator $url = null, Factory $view) { $this->url = $url; + $this->view = $view; } /** @@ -59,13 +72,13 @@ public function decode($value) * @param array $attributes * @param bool $secure * - * @return string + * @return \Illuminate\Support\HtmlString */ public function script($url, $attributes = [], $secure = null) { $attributes['src'] = $this->url->asset($url, $secure); - return 'attributes($attributes).'>'.PHP_EOL; + return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); } /** @@ -75,7 +88,7 @@ public function script($url, $attributes = [], $secure = null) * @param array $attributes * @param bool $secure * - * @return string + * @return \Illuminate\Support\HtmlString */ public function style($url, $attributes = [], $secure = null) { @@ -85,7 +98,7 @@ public function style($url, $attributes = [], $secure = null) $attributes['href'] = $this->url->asset($url, $secure); - return 'attributes($attributes).'>'.PHP_EOL; + return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); } /** @@ -96,13 +109,14 @@ public function style($url, $attributes = [], $secure = null) * @param array $attributes * @param bool $secure * - * @return string + * @return \Illuminate\Support\HtmlString */ public function image($url, $alt = null, $attributes = [], $secure = null) { $attributes['alt'] = $alt; - return 'attributes($attributes).'>'; + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -112,7 +126,7 @@ public function image($url, $alt = null, $attributes = [], $secure = null) * @param array $attributes * @param bool $secure * - * @return string + * @return \Illuminate\Support\HtmlString */ public function favicon($url, $attributes = [], $secure = null) { @@ -122,7 +136,7 @@ public function favicon($url, $attributes = [], $secure = null) $attributes['href'] = $this->url->asset($url, $secure); - return 'attributes($attributes).'>'.PHP_EOL; + return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); } /** @@ -132,10 +146,11 @@ public function favicon($url, $attributes = [], $secure = null) * @param string $title * @param array $attributes * @param bool $secure + * @param bool $escape * - * @return string + * @return \Illuminate\Support\HtmlString */ - public function link($url, $title = null, $attributes = [], $secure = null) + public function link($url, $title = null, $attributes = [], $secure = null, $escape = true) { $url = $this->url->to($url, [], $secure); @@ -143,7 +158,11 @@ public function link($url, $title = null, $attributes = [], $secure = null) $title = $url; } - return 'attributes($attributes).'>'.$this->entities($title).''; + if ($escape) { + $title = $this->entities($title); + } + + return $this->toHtmlString('attributes($attributes) . '>' . $title . ''); } /** @@ -153,7 +172,7 @@ public function link($url, $title = null, $attributes = [], $secure = null) * @param string $title * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function secureLink($url, $title = null, $attributes = []) { @@ -168,7 +187,7 @@ public function secureLink($url, $title = null, $attributes = []) * @param array $attributes * @param bool $secure * - * @return string + * @return \Illuminate\Support\HtmlString */ public function linkAsset($url, $title = null, $attributes = [], $secure = null) { @@ -184,7 +203,7 @@ public function linkAsset($url, $title = null, $attributes = [], $secure = null) * @param string $title * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function linkSecureAsset($url, $title = null, $attributes = []) { @@ -199,7 +218,7 @@ public function linkSecureAsset($url, $title = null, $attributes = []) * @param array $parameters * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function linkRoute($name, $title = null, $parameters = [], $attributes = []) { @@ -214,7 +233,7 @@ public function linkRoute($name, $title = null, $parameters = [], $attributes = * @param array $parameters * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function linkAction($action, $title = null, $parameters = [], $attributes = []) { @@ -227,18 +246,23 @@ public function linkAction($action, $title = null, $parameters = [], $attributes * @param string $email * @param string $title * @param array $attributes + * @param bool $escape * - * @return string + * @return \Illuminate\Support\HtmlString */ - public function mailto($email, $title = null, $attributes = []) + public function mailto($email, $title = null, $attributes = [], $escape = true) { $email = $this->email($email); $title = $title ?: $email; - $email = $this->obfuscate('mailto:').$email; + if ($escape) { + $title = $this->entities($title); + } + + $email = $this->obfuscate('mailto:') . $email; - return 'attributes($attributes).'>'.$this->entities($title).''; + return $this->toHtmlString('attributes($attributes) . '>' . $title . ''); } /** @@ -253,13 +277,25 @@ public function email($email) return str_replace('@', '@', $this->obfuscate($email)); } + /** + * Generates non-breaking space entities based on number supplied. + * + * @param int $num + * + * @return string + */ + public function nbsp($num = 1) + { + return str_repeat(' ', $num); + } + /** * Generate an ordered list of items. * * @param array $list * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString|string */ public function ol($list, $attributes = []) { @@ -272,7 +308,7 @@ public function ol($list, $attributes = []) * @param array $list * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString|string */ public function ul($list, $attributes = []) { @@ -285,7 +321,7 @@ public function ul($list, $attributes = []) * @param array $list * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function dl(array $list, array $attributes = []) { @@ -295,9 +331,9 @@ public function dl(array $list, array $attributes = []) foreach ($list as $key => $value) { $value = (array) $value; - + $html .= "
    $key
    "; - + foreach ($value as $v_key => $v_value) { $html .= "
    $v_value
    "; } @@ -305,7 +341,7 @@ public function dl(array $list, array $attributes = []) $html .= ''; - return $html; + return $this->toHtmlString($html); } /** @@ -315,7 +351,7 @@ public function dl(array $list, array $attributes = []) * @param array $list * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString|string */ protected function listing($type, $list, $attributes = []) { @@ -334,7 +370,7 @@ protected function listing($type, $list, $attributes = []) $attributes = $this->attributes($attributes); - return "<{$type}{$attributes}>{$html}"; + return $this->toHtmlString("<{$type}{$attributes}>{$html}"); } /** @@ -351,7 +387,7 @@ protected function listingElement($key, $type, $value) if (is_array($value)) { return $this->nestedListing($key, $type, $value); } else { - return '
  • '.e($value).'
  • '; + return '
  • ' . e($value) . '
  • '; } } @@ -369,7 +405,7 @@ protected function nestedListing($key, $type, $value) if (is_int($key)) { return $this->listing($type, $value); } else { - return '
  • '.$key.$this->listing($type, $value).'
  • '; + return '
  • ' . $key . $this->listing($type, $value) . '
  • '; } } @@ -387,12 +423,12 @@ public function attributes($attributes) foreach ((array) $attributes as $key => $value) { $element = $this->attributeElement($key, $value); - if (!is_null($element)) { + if (! is_null($element)) { $html[] = $element; } } - return count($html) > 0 ? ' '.implode(' ', $html) : ''; + return count($html) > 0 ? ' ' . implode(' ', $html) : ''; } /** @@ -405,15 +441,22 @@ public function attributes($attributes) */ protected function attributeElement($key, $value) { - // For numeric keys we will assume that the key and the value are the same - // as this will convert HTML attributes such as "required" to a correct - // form like required="required" instead of using incorrect numerics. + // For numeric keys we will assume that the value is a boolean attribute + // where the presence of the attribute represents a true value and the + // absence represents a false value. + // This will convert HTML attributes such as "required" to a correct + // form instead of using incorrect numerics. if (is_numeric($key)) { - $key = $value; + return $value; + } + + // Treat boolean attributes as HTML properties + if (is_bool($value) && $key != 'value') { + return $value ? $key : ''; } - if (!is_null($value)) { - return $key.'="'.e($value).'"'; + if (! is_null($value)) { + return $key . '="' . e($value) . '"'; } } @@ -438,10 +481,12 @@ public function obfuscate($value) // the randomly obfuscated letters out of the string on the responses. switch (rand(1, 3)) { case 1: - $safe .= '&#'.ord($letter).';'; break; + $safe .= '&#' . ord($letter) . ';'; + break; case 2: - $safe .= '&#x'.dechex(ord($letter)).';'; break; + $safe .= '&#x' . dechex(ord($letter)) . ';'; + break; case 3: $safe .= $letter; @@ -458,7 +503,7 @@ public function obfuscate($value) * @param string $content * @param array $attributes * - * @return string + * @return \Illuminate\Support\HtmlString */ public function meta($name, $content, array $attributes = []) { @@ -466,6 +511,56 @@ public function meta($name, $content, array $attributes = []) $attributes = array_merge($defaults, $attributes); - return 'attributes($attributes).'>'.PHP_EOL; + return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + } + + /** + * Generate an html tag. + * + * @param string $tag + * @param mixed $content + * @param array $attributes + * + * @return \Illuminate\Support\HtmlString + */ + public function tag($tag, $content, array $attributes = []) + { + $content = is_array($content) ? implode(PHP_EOL, $content) : $content; + return $this->toHtmlString('<' . $tag . $this->attributes($attributes) . '>' . PHP_EOL . $this->toHtmlString($content) . PHP_EOL . '' . PHP_EOL); + } + + /** + * Transform the string to an Html serializable object + * + * @param $html + * + * @return \Illuminate\Support\HtmlString + */ + protected function toHtmlString($html) + { + return new HtmlString($html); + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * + * @return \Illuminate\Contracts\View\View|mixed + * + * @throws \BadMethodCallException + */ + public function __call($method, $parameters) + { + if (static::hasComponent($method)) { + return $this->componentCall($method, $parameters); + } + + if (static::hasMacro($method)) { + return $this->macroCall($method, $parameters); + } + + throw new BadMethodCallException("Method {$method} does not exist."); } } diff --git a/application/vendor/laravelcollective/html/src/HtmlFacade.php b/application/vendor/laravelcollective/html/src/HtmlFacade.php index 1202359..127cdc8 100644 --- a/application/vendor/laravelcollective/html/src/HtmlFacade.php +++ b/application/vendor/laravelcollective/html/src/HtmlFacade.php @@ -9,6 +9,7 @@ */ class HtmlFacade extends Facade { + /** * Get the registered name of the component. * diff --git a/application/vendor/laravelcollective/html/src/HtmlServiceProvider.php b/application/vendor/laravelcollective/html/src/HtmlServiceProvider.php old mode 100644 new mode 100755 index 12c9608..e3aa134 --- a/application/vendor/laravelcollective/html/src/HtmlServiceProvider.php +++ b/application/vendor/laravelcollective/html/src/HtmlServiceProvider.php @@ -6,6 +6,7 @@ class HtmlServiceProvider extends ServiceProvider { + /** * Indicates if loading of the provider is deferred. * @@ -36,7 +37,7 @@ public function register() protected function registerHtmlBuilder() { $this->app->singleton('html', function ($app) { - return new HtmlBuilder($app['url']); + return new HtmlBuilder($app['url'], $app['view']); }); } @@ -48,7 +49,7 @@ protected function registerHtmlBuilder() protected function registerFormBuilder() { $this->app->singleton('form', function ($app) { - $form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken()); + $form = new FormBuilder($app['html'], $app['url'], $app['view'], $app['session.store']->getToken(), $app['request']); return $form->setSessionStore($app['session.store']); }); diff --git a/application/vendor/laravelcollective/html/src/helpers.php b/application/vendor/laravelcollective/html/src/helpers.php index b84673b..14f0361 100644 --- a/application/vendor/laravelcollective/html/src/helpers.php +++ b/application/vendor/laravelcollective/html/src/helpers.php @@ -1,6 +1,6 @@ link($url, $title, $attributes, $secure); + return app('html')->link($url, $title, $attributes, $secure, $escape); } } -if (!function_exists('link_to_asset')) { +if (! function_exists('link_to_asset')) { /** * Generate a HTML link to an asset. * @@ -34,7 +35,7 @@ function link_to_asset($url, $title = null, $attributes = [], $secure = null) } } -if (!function_exists('link_to_route')) { +if (! function_exists('link_to_route')) { /** * Generate a HTML link to a named route. * @@ -51,7 +52,7 @@ function link_to_route($name, $title = null, $parameters = [], $attributes = []) } } -if (!function_exists('link_to_action')) { +if (! function_exists('link_to_action')) { /** * Generate a HTML link to a controller action. * diff --git a/application/vendor/league/flysystem/CODE_OF_CONDUCT.md b/application/vendor/league/flysystem/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..89569c0 --- /dev/null +++ b/application/vendor/league/flysystem/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at info+flysystem@frankdejonge.nl. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/application/vendor/league/flysystem/SECURITY.md b/application/vendor/league/flysystem/SECURITY.md new file mode 100644 index 0000000..f5b205e --- /dev/null +++ b/application/vendor/league/flysystem/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 1.0.x | :white_check_mark: | +| 2.0.x | :x: | + +## Reporting a Vulnerability + +When you've encountered a security vulnerability, please disclose it securely. + +The security process is described at: +[https://flysystem.thephpleague.com/docs/security/](https://flysystem.thephpleague.com/docs/security/) + diff --git a/application/vendor/league/flysystem/composer.json b/application/vendor/league/flysystem/composer.json index 84229e9..bd7434a 100644 --- a/application/vendor/league/flysystem/composer.json +++ b/application/vendor/league/flysystem/composer.json @@ -1,11 +1,18 @@ { "name": "league/flysystem", + "type": "library", "description": "Filesystem abstraction: Many filesystems, one API.", "keywords": [ "filesystem", "filesystems", "files", "storage", "dropbox", "aws", "abstraction", "s3", "ftp", "sftp", "remote", "webdav", "file systems", "cloud", "cloud files", "rackspace", "copy.com" ], + "funding": [ + { + "type": "other", + "url": "https://offset.earth/frankdejonge" + } + ], "license": "MIT", "authors": [ { @@ -14,12 +21,13 @@ } ], "require": { - "php": ">=5.5.9", - "ext-fileinfo": "*" + "php": "^7.2.5 || ^8.0", + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3" }, "require-dev": { - "phpspec/phpspec": "^3.4", - "phpunit/phpunit": "^5.7.10" + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" }, "autoload": { "psr-4": { @@ -29,10 +37,7 @@ "autoload-dev": { "psr-4": { "League\\Flysystem\\Stub\\": "stub/" - }, - "files": [ - "tests/PHPUnitHacks.php" - ] + } }, "suggest": { "ext-fileinfo": "Required for MimeType", diff --git a/application/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/application/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php index 578b491..b232cdc 100644 --- a/application/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ b/application/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php @@ -440,7 +440,13 @@ protected function normalizeUnixObject($item, $base) $path = $base === '' ? $name : $base . $this->separator . $name; if ($type === 'dir') { - return compact('type', 'path'); + $result = compact('type', 'path'); + if ($this->enableTimestampsOnUnixListings) { + $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); + $result += compact('timestamp'); + } + + return $result; } $permissions = $this->normalizePermissions($permissions); @@ -557,6 +563,10 @@ protected function detectType($permissions) */ protected function normalizePermissions($permissions) { + if (is_numeric($permissions)) { + return ((int) $permissions) & 0777; + } + // remove the type identifier $permissions = substr($permissions, 1); @@ -635,10 +645,7 @@ public function ensureDirectory($dirname) */ public function getConnection() { - $tries = 0; - - while ( ! $this->isConnected() && $tries < 3) { - $tries++; + if ( ! $this->isConnected()) { $this->disconnect(); $this->connect(); } @@ -690,4 +697,9 @@ abstract public function disconnect(); * @return bool */ abstract public function isConnected(); + + protected function escapePath($path) + { + return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path); + } } diff --git a/application/vendor/league/flysystem/src/Adapter/Ftp.php b/application/vendor/league/flysystem/src/Adapter/Ftp.php index c984824..b009210 100644 --- a/application/vendor/league/flysystem/src/Adapter/Ftp.php +++ b/application/vendor/league/flysystem/src/Adapter/Ftp.php @@ -2,13 +2,14 @@ namespace League\Flysystem\Adapter; -use ErrorException; use League\Flysystem\Adapter\Polyfill\StreamedCopyTrait; use League\Flysystem\AdapterInterface; use League\Flysystem\Config; +use League\Flysystem\ConnectionErrorException; +use League\Flysystem\ConnectionRuntimeException; +use League\Flysystem\InvalidRootException; use League\Flysystem\Util; use League\Flysystem\Util\MimeType; -use RuntimeException; class Ftp extends AbstractFtpAdapter { @@ -128,14 +129,21 @@ public function setUtf8($utf8) */ public function connect() { + $tries = 3; + start_connecting: + if ($this->ssl) { - $this->connection = ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); + $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); } else { - $this->connection = ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); + $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); } if ( ! $this->connection) { - throw new RuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); + $tries--; + + if ($tries > 0) goto start_connecting; + + throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); } $this->login(); @@ -153,7 +161,7 @@ protected function setUtf8Mode() if ($this->utf8) { $response = ftp_raw($this->connection, "OPTS UTF8 ON"); if (substr($response[0], 0, 3) !== '200') { - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); } @@ -163,7 +171,7 @@ protected function setUtf8Mode() /** * Set the connections to passive mode. * - * @throws RuntimeException + * @throws ConnectionRuntimeException */ protected function setConnectionPassiveMode() { @@ -172,7 +180,7 @@ protected function setConnectionPassiveMode() } if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); } @@ -187,7 +195,7 @@ protected function setConnectionRoot() $connection = $this->connection; if ($root && ! ftp_chdir($connection, $root)) { - throw new RuntimeException('Root is invalid or does not exist: ' . $this->getRoot()); + throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); } // Store absolute path for further reference. @@ -200,7 +208,7 @@ protected function setConnectionRoot() /** * Login. * - * @throws RuntimeException + * @throws ConnectionRuntimeException */ protected function login() { @@ -215,7 +223,7 @@ protected function login() if ( ! $isLoggedIn) { $this->disconnect(); - throw new RuntimeException( + throw new ConnectionRuntimeException( 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( ) . ', username: ' . $this->getUsername() ); @@ -228,7 +236,7 @@ protected function login() public function disconnect() { if (is_resource($this->connection)) { - ftp_close($this->connection); + @ftp_close($this->connection); } $this->connection = null; @@ -392,7 +400,7 @@ public function getMetadata($path) return ['type' => 'dir', 'path' => $path]; } - $listing = $this->ftpRawlist('-A', str_replace('*', '\\*', $path)); + $listing = $this->ftpRawlist('-A', $path); if (empty($listing) || in_array('total 0', $listing, true)) { return false; @@ -488,8 +496,6 @@ public function setVisibility($path, $visibility) */ protected function listDirectoryContents($directory, $recursive = true) { - $directory = str_replace('*', '\\*', $directory); - if ($recursive && $this->recurseManually) { return $this->listDirectoryContentsRecursive($directory); } @@ -526,19 +532,12 @@ protected function listDirectoryContentsRecursive($directory) * * @return bool * - * @throws ErrorException + * @throws ConnectionErrorException */ public function isConnected() { - try { - return is_resource($this->connection) && ftp_rawlist($this->connection, $this->getRoot()) !== false; - } catch (ErrorException $e) { - if (strpos($e->getMessage(), 'ftp_rawlist') === false) { - throw $e; - } - - return false; - } + return is_resource($this->connection) + && $this->getRawExecResponseCode('NOOP') === 200; } /** @@ -565,8 +564,16 @@ protected function ftpRawlist($options, $path) if ($this->isPureFtpd) { $path = str_replace(' ', '\ ', $path); + $this->escapePath($path); } return ftp_rawlist($connection, $options . ' ' . $path); } + + private function getRawExecResponseCode($command) + { + $response = @ftp_raw($this->connection, trim($command)); + + return (int) preg_replace('/\D/', '', implode(' ', $response)); + } } diff --git a/application/vendor/league/flysystem/src/Adapter/Ftpd.php b/application/vendor/league/flysystem/src/Adapter/Ftpd.php index d5349e4..7e71d19 100644 --- a/application/vendor/league/flysystem/src/Adapter/Ftpd.php +++ b/application/vendor/league/flysystem/src/Adapter/Ftpd.php @@ -12,13 +12,16 @@ public function getMetadata($path) if ($path === '') { return ['type' => 'dir', 'path' => '']; } + if (@ftp_chdir($this->getConnection(), $path) === true) { $this->setConnectionRoot(); return ['type' => 'dir', 'path' => $path]; } - if ( ! ($object = ftp_raw($this->getConnection(), 'STAT ' . $path)) || count($object) < 3) { + $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path)); + + if ( ! $object || count($object) < 3) { return false; } @@ -34,7 +37,7 @@ public function getMetadata($path) */ protected function listDirectoryContents($directory, $recursive = true) { - $listing = ftp_rawlist($this->getConnection(), $directory, $recursive); + $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive); if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) { return []; diff --git a/application/vendor/league/flysystem/src/Adapter/Local.php b/application/vendor/league/flysystem/src/Adapter/Local.php index c6e6fa8..747c463 100644 --- a/application/vendor/league/flysystem/src/Adapter/Local.php +++ b/application/vendor/league/flysystem/src/Adapter/Local.php @@ -206,8 +206,9 @@ public function update($path, $contents, Config $config) $result = compact('type', 'path', 'size', 'contents'); - if ($mimetype = $config->get('mimetype') ?: Util::guessMimeType($path, $contents)) { - $result['mimetype'] = $mimetype; + if ($visibility = $config->get('visibility')) { + $this->setVisibility($path, $visibility); + $result['visibility'] = $visibility; } return $result; @@ -287,6 +288,8 @@ public function listContents($directory = '', $recursive = false) $result[] = $this->normalizeFileInfo($file); } + unset($iterator); + return array_filter($result); } @@ -412,6 +415,8 @@ public function deleteDir($dirname) $this->deleteFileInfoObject($file); } + unset($contents); + return rmdir($location); } diff --git a/application/vendor/league/flysystem/src/ConnectionErrorException.php b/application/vendor/league/flysystem/src/ConnectionErrorException.php new file mode 100644 index 0000000..adb651d --- /dev/null +++ b/application/vendor/league/flysystem/src/ConnectionErrorException.php @@ -0,0 +1,9 @@ +getMetadata($path); - $handler = $metadata['type'] === 'file' ? new File($this, $path) : new Directory($this, $path); + $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path); } $handler->setPath($path); diff --git a/application/vendor/league/flysystem/src/FilesystemException.php b/application/vendor/league/flysystem/src/FilesystemException.php new file mode 100644 index 0000000..3121e53 --- /dev/null +++ b/application/vendor/league/flysystem/src/FilesystemException.php @@ -0,0 +1,7 @@ +filesystem->getMetadata($this->path); - return $metadata['type']; + return $metadata ? $metadata['type'] : 'dir'; } /** diff --git a/application/vendor/league/flysystem/src/InvalidRootException.php b/application/vendor/league/flysystem/src/InvalidRootException.php new file mode 100644 index 0000000..468d1d5 --- /dev/null +++ b/application/vendor/league/flysystem/src/InvalidRootException.php @@ -0,0 +1,9 @@ + 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'csv' => 'text/csv', - 'bin' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'class' => 'application/octet-stream', - 'psd' => 'application/x-photoshop', - 'so' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => 'application/pdf', - 'ai' => 'application/pdf', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => 'application/vnd.ms-excel', - 'xlt' => 'application/vnd.ms-excel', - 'xla' => 'application/vnd.ms-excel', - 'ppt' => 'application/powerpoint', - 'pot' => 'application/vnd.ms-powerpoint', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppa' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'wbxml' => 'application/wbxml', - 'wmlc' => 'application/wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'gz' => 'application/x-gzip', - 'gzip' => 'application/x-gzip', - 'php' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'js' => 'application/javascript', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => 'application/x-tar', - 'z' => 'application/x-compress', - 'xhtml' => 'application/xhtml+xml', - 'xht' => 'application/xhtml+xml', - 'rdf' => 'application/rdf+xml', - 'zip' => 'application/x-zip', - 'rar' => 'application/x-rar', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'rv' => 'video/vnd.rn-realvideo', - 'wav' => 'audio/x-wav', - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'png' => 'image/png', - 'gif' => 'image/gif', - 'bmp' => 'image/bmp', - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'svg' => 'image/svg+xml', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'txt' => 'text/plain', - 'text' => 'text/plain', - 'log' => 'text/plain', - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'xml' => 'application/xml', - 'xsl' => 'application/xml', - 'dmn' => 'application/octet-stream', - 'bpmn' => 'application/octet-stream', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'dot' => 'application/msword', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'word' => 'application/msword', - 'xl' => 'application/excel', - 'eml' => 'message/rfc822', - 'json' => 'application/json', - 'pem' => 'application/x-x509-user-cert', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7a' => 'application/x-pkcs7-signature', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'crt' => 'application/x-x509-ca-cert', - 'crl' => 'application/pkix-crl', - 'der' => 'application/x-x509-ca-cert', - 'kdb' => 'application/octet-stream', - 'pgp' => 'application/pgp', - 'gpg' => 'application/gpg-keys', - 'sst' => 'application/octet-stream', - 'csr' => 'application/octet-stream', - 'rsa' => 'application/x-pkcs7', - 'cer' => 'application/pkix-cert', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', - 'mp4' => 'video/mp4', - 'm4a' => 'audio/x-m4a', - 'f4v' => 'video/mp4', - 'webm' => 'video/webm', - 'aac' => 'audio/x-acc', - 'm4u' => 'application/vnd.mpegurl', - 'm3u' => 'text/plain', - 'xspf' => 'application/xspf+xml', - 'vlc' => 'application/videolan', - 'wmv' => 'video/x-ms-wmv', - 'au' => 'audio/x-au', - 'ac3' => 'audio/ac3', - 'flac' => 'audio/x-flac', - 'ogg' => 'audio/ogg', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'ics' => 'text/calendar', - 'zsh' => 'text/x-scriptzsh', - '7zip' => 'application/x-7z-compressed', - 'cdr' => 'application/cdr', - 'wma' => 'audio/x-ms-wma', - 'jar' => 'application/java-archive', - 'tex' => 'application/x-tex', - 'latex' => 'application/x-latex', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - ]; + protected static $extensionToMimeTypeMap = GeneratedExtensionToMimeTypeMap::MIME_TYPES_FOR_EXTENSIONS; + protected static $detector; + + public static function useDetector(MimeTypeDetector $detector) + { + static::$detector = $detector; + } + + /** + * @return MimeTypeDetector + */ + protected static function detector() + { + if ( ! static::$detector instanceof MimeTypeDetector) { + static::$detector = new FinfoMimeTypeDetector(); + } + + return static::$detector; + } + /** * Detects MIME Type based on given content. * * @param mixed $content * - * @return string|null MIME Type or NULL if no mime type detected + * @return string MIME Type */ public static function detectByContent($content) { - if ( ! class_exists('finfo') || ! is_string($content)) { - return null; + if (is_string($content)) { + return static::detector()->detectMimeTypeFromBuffer($content); } - try { - $finfo = new finfo(FILEINFO_MIME_TYPE); - return $finfo->buffer($content) ?: null; - // @codeCoverageIgnoreStart - } catch (ErrorException $e) { - // This is caused by an array to string conversion error. - } - } // @codeCoverageIgnoreEnd + return 'text/plain'; + } /** * Detects MIME Type based on file extension. * * @param string $extension * - * @return string|null MIME Type or NULL if no extension detected + * @return string MIME Type */ public static function detectByFileExtension($extension) { - return isset(static::$extensionToMimeTypeMap[$extension]) - ? static::$extensionToMimeTypeMap[$extension] - : 'text/plain'; + return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain'; } /** * @param string $filename * - * @return string|null MIME Type or NULL if no extension detected + * @return string MIME Type */ public static function detectByFilename($filename) { - $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); - - return empty($extension) ? 'text/plain' : static::detectByFileExtension($extension); + return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain'; } /** diff --git a/application/vendor/symfony/polyfill-php56/LICENSE b/application/vendor/league/mime-type-detection/LICENSE similarity index 96% rename from application/vendor/symfony/polyfill-php56/LICENSE rename to application/vendor/league/mime-type-detection/LICENSE index 4cd8bdd..7c1027d 100644 --- a/application/vendor/symfony/polyfill-php56/LICENSE +++ b/application/vendor/league/mime-type-detection/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2013-2020 Frank de Jonge Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/application/vendor/league/mime-type-detection/composer.json b/application/vendor/league/mime-type-detection/composer.json new file mode 100644 index 0000000..19a62a7 --- /dev/null +++ b/application/vendor/league/mime-type-detection/composer.json @@ -0,0 +1,24 @@ +{ + "name": "league/mime-type-detection", + "description": "Mime-type detection for Flysystem", + "license": "MIT", + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "require": { + "php": "^7.2 || ^8.0", + "ext-fileinfo": "*" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.8", + "phpstan/phpstan": "^0.12.36" + }, + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + } +} diff --git a/application/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/application/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php new file mode 100644 index 0000000..fc04241 --- /dev/null +++ b/application/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php @@ -0,0 +1,13 @@ +extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap(); + } + + public function detectMimeType(string $path, $contents): ?string + { + return $this->detectMimeTypeFromPath($path); + } + + public function detectMimeTypeFromPath(string $path): ?string + { + $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); + + return $this->extensions->lookupMimeType($extension); + } + + public function detectMimeTypeFromFile(string $path): ?string + { + return $this->detectMimeTypeFromPath($path); + } + + public function detectMimeTypeFromBuffer(string $contents): ?string + { + return null; + } +} diff --git a/application/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/application/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php new file mode 100644 index 0000000..1dad7bc --- /dev/null +++ b/application/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php @@ -0,0 +1,10 @@ +finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); + $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); + } + + public function detectMimeType(string $path, $contents): ?string + { + $mimeType = is_string($contents) + ? (@$this->finfo->buffer($contents) ?: null) + : null; + + if ($mimeType !== null && ! in_array($mimeType, self::INCONCLUSIVE_MIME_TYPES)) { + return $mimeType; + } + + return $this->detectMimeTypeFromPath($path); + } + + public function detectMimeTypeFromPath(string $path): ?string + { + $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); + + return $this->extensionMap->lookupMimeType($extension); + } + + public function detectMimeTypeFromFile(string $path): ?string + { + return @$this->finfo->file($path) ?: null; + } + + public function detectMimeTypeFromBuffer(string $contents): ?string + { + return @$this->finfo->buffer($contents) ?: null; + } +} + diff --git a/application/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/application/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php new file mode 100644 index 0000000..a208647 --- /dev/null +++ b/application/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php @@ -0,0 +1,1207 @@ + 'application/vnd.1000minds.decision-model+xml', + '3dml' => 'text/vnd.in3d.3dml', + '3ds' => 'image/x-3ds', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gp', + '3gpp' => 'video/3gpp', + '3mf' => 'model/3mf', + '7z' => 'application/x-7z-compressed', + '7zip' => 'application/x-7z-compressed', + '123' => 'application/vnd.lotus-1-2-3', + 'aab' => 'application/x-authorware-bin', + 'aac' => 'audio/x-acc', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'ac' => 'application/vnd.nokia.n-gage.ac+xml', + 'ac3' => 'audio/ac3', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + 'acu' => 'application/vnd.acucobol', + 'acutc' => 'application/vnd.acucorp', + 'adp' => 'audio/adpcm', + 'aep' => 'application/vnd.audiograph', + 'afm' => 'application/x-font-type1', + 'afp' => 'application/vnd.ibm.modcap', + 'ahead' => 'application/vnd.ahead.space', + 'ai' => 'application/pdf', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'air' => 'application/vnd.adobe.air-application-installer-package+zip', + 'ait' => 'application/vnd.dvb.ait', + 'ami' => 'application/vnd.amiga.ami', + 'apk' => 'application/vnd.android.package-archive', + 'apng' => 'image/apng', + 'appcache' => 'text/cache-manifest', + 'application' => 'application/x-ms-application', + 'apr' => 'application/vnd.lotus-approach', + 'arc' => 'application/x-freearc', + 'arj' => 'application/x-arj', + 'asc' => 'application/pgp-signature', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'aso' => 'application/vnd.accpac.simply.aso', + 'asx' => 'video/x-ms-asf', + 'atc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomdeleted' => 'application/atomdeleted+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au' => 'audio/x-au', + 'avi' => 'video/x-msvideo', + 'avif' => 'image/avif', + 'aw' => 'application/applixware', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azv' => 'image/vnd.airzip.accelerator.azv', + 'azw' => 'application/vnd.amazon.ebook', + 'b16' => 'image/vnd.pco.b16', + 'bat' => 'application/x-msdownload', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bdoc' => 'application/x-bdoc', + 'bed' => 'application/vnd.realvnc.bed', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin' => 'application/octet-stream', + 'blb' => 'application/x-blorb', + 'blorb' => 'application/x-blorb', + 'bmi' => 'application/vnd.bmi', + 'bmml' => 'application/vnd.balsamiq.bmml+xml', + 'bmp' => 'image/bmp', + 'book' => 'application/vnd.framemaker', + 'box' => 'application/vnd.previewsystems.box', + 'boz' => 'application/x-bzip2', + 'bpk' => 'application/octet-stream', + 'bpmn' => 'application/octet-stream', + 'bsp' => 'model/vnd.valve.source.compiled-map', + 'btif' => 'image/prs.btif', + 'buffer' => 'application/octet-stream', + 'bz' => 'application/x-bzip', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c4d' => 'application/vnd.clonk.c4group', + 'c4f' => 'application/vnd.clonk.c4group', + 'c4g' => 'application/vnd.clonk.c4group', + 'c4p' => 'application/vnd.clonk.c4group', + 'c4u' => 'application/vnd.clonk.c4group', + 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', + 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', + 'cab' => 'application/vnd.ms-cab-compressed', + 'caf' => 'audio/x-caf', + 'cap' => 'application/vnd.tcpdump.pcap', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cb7' => 'application/x-cbr', + 'cba' => 'application/x-cbr', + 'cbr' => 'application/x-cbr', + 'cbt' => 'application/x-cbr', + 'cbz' => 'application/x-cbr', + 'cc' => 'text/x-c', + 'cco' => 'application/x-cocoa', + 'cct' => 'application/x-director', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdf' => 'application/x-netcdf', + 'cdfx' => 'application/cdfx+xml', + 'cdkey' => 'application/vnd.mediastation.cdkey', + 'cdmia' => 'application/cdmi-capability', + 'cdmic' => 'application/cdmi-container', + 'cdmid' => 'application/cdmi-domain', + 'cdmio' => 'application/cdmi-object', + 'cdmiq' => 'application/cdmi-queue', + 'cdr' => 'application/cdr', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cfs' => 'application/x-cfs-compressed', + 'cgm' => 'image/cgm', + 'chat' => 'application/x-chat', + 'chm' => 'application/vnd.ms-htmlhelp', + 'chrt' => 'application/vnd.kde.kchart', + 'cif' => 'chemical/x-cif', + 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', + 'cil' => 'application/vnd.ms-artgalry', + 'cjs' => 'application/node', + 'cla' => 'application/vnd.claymore', + 'class' => 'application/octet-stream', + 'clkk' => 'application/vnd.crick.clicker.keyboard', + 'clkp' => 'application/vnd.crick.clicker.palette', + 'clkt' => 'application/vnd.crick.clicker.template', + 'clkw' => 'application/vnd.crick.clicker.wordbank', + 'clkx' => 'application/vnd.crick.clicker', + 'clp' => 'application/x-msclip', + 'cmc' => 'application/vnd.cosmocaller', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cmp' => 'application/vnd.yellowriver-custom-menu', + 'cmx' => 'image/x-cmx', + 'cod' => 'application/vnd.rim.cod', + 'coffee' => 'text/coffeescript', + 'com' => 'application/x-msdownload', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'crx' => 'application/x-chrome-extension', + 'cryptonote' => 'application/vnd.rig.cryptonote', + 'csh' => 'application/x-csh', + 'csl' => 'application/vnd.citationstyles.style+xml', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'csr' => 'application/octet-stream', + 'css' => 'text/css', + 'cst' => 'application/x-director', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'curl' => 'text/vnd.curl', + 'cww' => 'application/prs.cww', + 'cxt' => 'application/x-director', + 'cxx' => 'text/x-c', + 'dae' => 'model/vnd.collada+xml', + 'daf' => 'application/vnd.mobius.daf', + 'dart' => 'application/vnd.dart', + 'dataless' => 'application/vnd.fdsn.seed', + 'davmount' => 'application/davmount+xml', + 'dbf' => 'application/vnd.dbf', + 'dbk' => 'application/docbook+xml', + 'dcr' => 'application/x-director', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'ddf' => 'application/vnd.syncml.dmddf+xml', + 'dds' => 'image/vnd.ms-dds', + 'deb' => 'application/x-debian-package', + 'def' => 'text/plain', + 'deploy' => 'application/octet-stream', + 'der' => 'application/x-x509-ca-cert', + 'dfac' => 'application/vnd.dreamfactory', + 'dgc' => 'application/x-dgc-compressed', + 'dic' => 'text/x-c', + 'dir' => 'application/x-director', + 'dis' => 'application/vnd.mobius.dis', + 'disposition-notification' => 'message/disposition-notification', + 'dist' => 'application/octet-stream', + 'distz' => 'application/octet-stream', + 'djv' => 'image/vnd.djvu', + 'djvu' => 'image/vnd.djvu', + 'dll' => 'application/octet-stream', + 'dmg' => 'application/x-apple-diskimage', + 'dmn' => 'application/octet-stream', + 'dmp' => 'application/vnd.tcpdump.pcap', + 'dms' => 'application/octet-stream', + 'dna' => 'application/vnd.dna', + 'doc' => 'application/msword', + 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dot' => 'application/msword', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'dp' => 'application/vnd.osgi.dp', + 'dpg' => 'application/vnd.dpgraph', + 'dra' => 'audio/vnd.dra', + 'drle' => 'image/dicom-rle', + 'dsc' => 'text/prs.lines.tag', + 'dssc' => 'application/dssc+der', + 'dtb' => 'application/x-dtbook+xml', + 'dtd' => 'application/xml-dtd', + 'dts' => 'audio/vnd.dts', + 'dtshd' => 'audio/vnd.dts.hd', + 'dump' => 'application/octet-stream', + 'dvb' => 'video/vnd.dvb.file', + 'dvi' => 'application/x-dvi', + 'dwd' => 'application/atsc-dwd+xml', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'dxr' => 'application/x-director', + 'ear' => 'application/java-archive', + 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', + 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', + 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', + 'ecma' => 'application/ecmascript', + 'edm' => 'application/vnd.novadigm.edm', + 'edx' => 'application/vnd.novadigm.edx', + 'efif' => 'application/vnd.picsel', + 'ei6' => 'application/vnd.pg.osasli', + 'elc' => 'application/octet-stream', + 'emf' => 'image/emf', + 'eml' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'emotionml' => 'application/emotionml+xml', + 'emz' => 'application/x-msmetafile', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'es' => 'application/ecmascript', + 'es3' => 'application/vnd.eszigno3+xml', + 'esa' => 'application/vnd.osgi.subsystem', + 'esf' => 'application/vnd.epson.esf', + 'et3' => 'application/vnd.eszigno3+xml', + 'etx' => 'text/x-setext', + 'eva' => 'application/x-eva', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'exi' => 'application/exi', + 'exr' => 'image/aces', + 'ext' => 'application/vnd.novadigm.ext', + 'ez' => 'application/andrew-inset', + 'ez2' => 'application/vnd.ezpix-album', + 'ez3' => 'application/vnd.ezpix-package', + 'f' => 'text/x-fortran', + 'f4v' => 'video/mp4', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fbs' => 'image/vnd.fastbidsheet', + 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', + 'fcs' => 'application/vnd.isac.fcs', + 'fdf' => 'application/vnd.fdf', + 'fdt' => 'application/fdt+xml', + 'fe_launch' => 'application/vnd.denovo.fcselayout-link', + 'fg5' => 'application/vnd.fujitsu.oasysgp', + 'fgd' => 'application/x-director', + 'fh' => 'image/x-freehand', + 'fh4' => 'image/x-freehand', + 'fh5' => 'image/x-freehand', + 'fh7' => 'image/x-freehand', + 'fhc' => 'image/x-freehand', + 'fig' => 'application/x-xfig', + 'fits' => 'image/fits', + 'flac' => 'audio/x-flac', + 'fli' => 'video/x-fli', + 'flo' => 'application/vnd.micrografx.flo', + 'flv' => 'video/x-flv', + 'flw' => 'application/vnd.kde.kivio', + 'flx' => 'text/vnd.fmi.flexstor', + 'fly' => 'text/vnd.fly', + 'fm' => 'application/vnd.framemaker', + 'fnc' => 'application/vnd.frogans.fnc', + 'fo' => 'application/vnd.software602.filler.form+xml', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frame' => 'application/vnd.framemaker', + 'fsc' => 'application/vnd.fsc.weblaunch', + 'fst' => 'image/vnd.fst', + 'ftc' => 'application/vnd.fluxtime.clip', + 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', + 'fvt' => 'video/vnd.fvt', + 'fxp' => 'application/vnd.adobe.fxp', + 'fxpl' => 'application/vnd.adobe.fxp', + 'fzs' => 'application/vnd.fuzzysheet', + 'g2w' => 'application/vnd.geoplan', + 'g3' => 'image/g3fax', + 'g3w' => 'application/vnd.geospace', + 'gac' => 'application/vnd.groove-account', + 'gam' => 'application/x-tads', + 'gbr' => 'application/rpki-ghostbusters', + 'gca' => 'application/x-gca-compressed', + 'gdl' => 'model/vnd.gdl', + 'gdoc' => 'application/vnd.google-apps.document', + 'geo' => 'application/vnd.dynageo', + 'geojson' => 'application/geo+json', + 'gex' => 'application/vnd.geometry-explorer', + 'ggb' => 'application/vnd.geogebra.file', + 'ggt' => 'application/vnd.geogebra.tool', + 'ghf' => 'application/vnd.groove-help', + 'gif' => 'image/gif', + 'gim' => 'application/vnd.groove-identity-message', + 'glb' => 'model/gltf-binary', + 'gltf' => 'model/gltf+json', + 'gml' => 'application/gml+xml', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gpg' => 'application/gpg-keys', + 'gph' => 'application/vnd.flographit', + 'gpx' => 'application/gpx+xml', + 'gqf' => 'application/vnd.grafeq', + 'gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'gramps' => 'application/x-gramps-xml', + 'gre' => 'application/vnd.geometry-explorer', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gsheet' => 'application/vnd.google-apps.spreadsheet', + 'gslides' => 'application/vnd.google-apps.presentation', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gxf' => 'application/gxf', + 'gxt' => 'application/vnd.geonext', + 'gz' => 'application/x-gzip', + 'gzip' => 'application/x-gzip', + 'h' => 'text/x-c', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hal' => 'application/vnd.hal+xml', + 'hbci' => 'application/vnd.hbci', + 'hbs' => 'text/x-handlebars-template', + 'hdd' => 'application/x-virtualbox-hdd', + 'hdf' => 'application/x-hdf', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'hej2' => 'image/hej2k', + 'held' => 'application/atsc-held+xml', + 'hh' => 'text/x-c', + 'hjson' => 'application/hjson', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'hsj2' => 'image/hsj2', + 'htc' => 'text/x-component', + 'htke' => 'application/vnd.kenameaapp', + 'htm' => 'text/html', + 'html' => 'text/html', + 'hvd' => 'application/vnd.yamaha.hv-dic', + 'hvp' => 'application/vnd.yamaha.hv-voice', + 'hvs' => 'application/vnd.yamaha.hv-script', + 'i2g' => 'application/vnd.intergeo', + 'icc' => 'application/vnd.iccprofile', + 'ice' => 'x-conference/x-cooltalk', + 'icm' => 'application/vnd.iccprofile', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ief' => 'image/ief', + 'ifb' => 'text/calendar', + 'ifm' => 'application/vnd.shana.informed.formdata', + 'iges' => 'model/iges', + 'igl' => 'application/vnd.igloader', + 'igm' => 'application/vnd.insors.igm', + 'igs' => 'model/iges', + 'igx' => 'application/vnd.micrografx.igx', + 'iif' => 'application/vnd.shana.informed.interchange', + 'img' => 'application/octet-stream', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'in' => 'text/plain', + 'ini' => 'text/plain', + 'ink' => 'application/inkml+xml', + 'inkml' => 'application/inkml+xml', + 'install' => 'application/x-install-instructions', + 'iota' => 'application/vnd.astraea-software.iota', + 'ipfix' => 'application/ipfix', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'iso' => 'application/x-iso9660-image', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'its' => 'application/its+xml', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jade' => 'text/jade', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'jardiff' => 'application/x-java-archive-diff', + 'java' => 'text/x-java-source', + 'jhc' => 'image/jphc', + 'jisp' => 'application/vnd.jisp', + 'jls' => 'image/jls', + 'jlt' => 'application/vnd.hp-jlyt', + 'jng' => 'image/x-jng', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jp2' => 'image/jp2', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpf' => 'image/jpx', + 'jpg' => 'image/jpeg', + 'jpg2' => 'image/jp2', + 'jpgm' => 'video/jpm', + 'jpgv' => 'video/jpeg', + 'jph' => 'image/jph', + 'jpm' => 'video/jpm', + 'jpx' => 'image/jpx', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'json5' => 'application/json5', + 'jsonld' => 'application/ld+json', + 'jsonml' => 'application/jsonml+json', + 'jsx' => 'text/jsx', + 'jxr' => 'image/jxr', + 'jxra' => 'image/jxra', + 'jxrs' => 'image/jxrs', + 'jxs' => 'image/jxs', + 'jxsc' => 'image/jxsc', + 'jxsi' => 'image/jxsi', + 'jxss' => 'image/jxss', + 'kar' => 'audio/midi', + 'karbon' => 'application/vnd.kde.karbon', + 'kdb' => 'application/octet-stream', + 'kdbx' => 'application/x-keepass2', + 'key' => 'application/vnd.apple.keynote', + 'kfo' => 'application/vnd.kde.kformula', + 'kia' => 'application/vnd.kidspiration', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'kne' => 'application/vnd.kinar', + 'knp' => 'application/vnd.kinar', + 'kon' => 'application/vnd.kde.kontour', + 'kpr' => 'application/vnd.kde.kpresenter', + 'kpt' => 'application/vnd.kde.kpresenter', + 'kpxx' => 'application/vnd.ds-keypoint', + 'ksp' => 'application/vnd.kde.kspread', + 'ktr' => 'application/vnd.kahootz', + 'ktx' => 'image/ktx', + 'ktx2' => 'image/ktx2', + 'ktz' => 'application/vnd.kahootz', + 'kwd' => 'application/vnd.kde.kword', + 'kwt' => 'application/vnd.kde.kword', + 'lasxml' => 'application/vnd.las.las+xml', + 'latex' => 'application/x-latex', + 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', + 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', + 'les' => 'application/vnd.hhe.lesson-player', + 'less' => 'text/less', + 'lgr' => 'application/lgr+xml', + 'lha' => 'application/octet-stream', + 'link66' => 'application/vnd.route66.link66+xml', + 'list' => 'text/plain', + 'list3820' => 'application/vnd.ibm.modcap', + 'listafp' => 'application/vnd.ibm.modcap', + 'litcoffee' => 'text/coffeescript', + 'lnk' => 'application/x-ms-shortcut', + 'log' => 'text/plain', + 'lostxml' => 'application/lost+xml', + 'lrf' => 'application/octet-stream', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lua' => 'text/x-lua', + 'luac' => 'application/x-lua-bytecode', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'lzh' => 'application/octet-stream', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3a' => 'audio/mpeg', + 'm3u' => 'text/plain', + 'm3u8' => 'application/vnd.apple.mpegurl', + 'm4a' => 'audio/x-m4a', + 'm4p' => 'application/mp4', + 'm4u' => 'application/vnd.mpegurl', + 'm4v' => 'video/x-m4v', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm21' => 'application/mp21', + 'ma' => 'application/mathematica', + 'mads' => 'application/mads+xml', + 'maei' => 'application/mmt-aei+xml', + 'mag' => 'application/vnd.ecowin.chart', + 'maker' => 'application/vnd.framemaker', + 'man' => 'text/troff', + 'manifest' => 'text/cache-manifest', + 'map' => 'application/json', + 'mar' => 'application/octet-stream', + 'markdown' => 'text/markdown', + 'mathml' => 'application/mathml+xml', + 'mb' => 'application/mathematica', + 'mbk' => 'application/vnd.mobius.mbk', + 'mbox' => 'application/mbox', + 'mc1' => 'application/vnd.medcalcdata', + 'mcd' => 'application/vnd.mcd', + 'mcurl' => 'text/vnd.curl.mcurl', + 'md' => 'text/markdown', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'mdx' => 'text/mdx', + 'me' => 'text/troff', + 'mesh' => 'model/mesh', + 'meta4' => 'application/metalink4+xml', + 'metalink' => 'application/metalink+xml', + 'mets' => 'application/mets+xml', + 'mfm' => 'application/vnd.mfmp', + 'mft' => 'application/rpki-manifest', + 'mgp' => 'application/vnd.osgeo.mapguide.package', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mie' => 'application/x-mie', + 'mif' => 'application/vnd.mif', + 'mime' => 'message/rfc822', + 'mj2' => 'video/mj2', + 'mjp2' => 'video/mj2', + 'mjs' => 'application/javascript', + 'mk3d' => 'video/x-matroska', + 'mka' => 'audio/x-matroska', + 'mkd' => 'text/x-markdown', + 'mks' => 'video/x-matroska', + 'mkv' => 'video/x-matroska', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mml' => 'text/mathml', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mng' => 'video/x-mng', + 'mny' => 'application/x-msmoney', + 'mobi' => 'application/x-mobipocket-ebook', + 'mods' => 'application/mods+xml', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp2a' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4v' => 'video/mp4', + 'mp21' => 'application/mp21', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpd' => 'application/dash+xml', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'mpga' => 'audio/mpeg', + 'mpkg' => 'application/vnd.apple.installer+xml', + 'mpm' => 'application/vnd.blueice.multipass', + 'mpn' => 'application/vnd.mophun.application', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/vnd.ms-project', + 'mpy' => 'application/vnd.ibm.minipay', + 'mqy' => 'application/vnd.mobius.mqy', + 'mrc' => 'application/marc', + 'mrcx' => 'application/marcxml+xml', + 'ms' => 'text/troff', + 'mscml' => 'application/mediaservercontrol+xml', + 'mseed' => 'application/vnd.fdsn.mseed', + 'mseq' => 'application/vnd.mseq', + 'msf' => 'application/vnd.epson.msf', + 'msg' => 'application/vnd.ms-outlook', + 'msh' => 'model/mesh', + 'msi' => 'application/x-msdownload', + 'msl' => 'application/vnd.mobius.msl', + 'msm' => 'application/octet-stream', + 'msp' => 'application/octet-stream', + 'msty' => 'application/vnd.muvee.style', + 'mtl' => 'model/mtl', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musd' => 'application/mmt-usd+xml', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb' => 'application/x-msmediaview', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + 'mxmf' => 'audio/mobile-xmf', + 'mxml' => 'application/xv+xml', + 'mxs' => 'application/vnd.triscape.mxs', + 'mxu' => 'video/vnd.mpegurl', + 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', + 'n3' => 'text/n3', + 'nb' => 'application/mathematica', + 'nbp' => 'application/vnd.wolfram.player', + 'nc' => 'application/x-netcdf', + 'ncx' => 'application/x-dtbncx+xml', + 'nfo' => 'text/x-nfo', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + 'nitf' => 'application/vnd.nitf', + 'nlu' => 'application/vnd.neurolanguage.nlu', + 'nml' => 'application/vnd.enliven', + 'nnd' => 'application/vnd.noblenet-directory', + 'nns' => 'application/vnd.noblenet-sealer', + 'nnw' => 'application/vnd.noblenet-web', + 'npx' => 'image/vnd.net-fpx', + 'nq' => 'application/n-quads', + 'nsc' => 'application/x-conference', + 'nsf' => 'application/vnd.lotus-notes', + 'nt' => 'application/n-triples', + 'ntf' => 'application/vnd.nitf', + 'numbers' => 'application/vnd.apple.numbers', + 'nzb' => 'application/x-nzb', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + 'obgx' => 'application/vnd.openblox.game+xml', + 'obj' => 'model/obj', + 'oda' => 'application/oda', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odft' => 'application/vnd.oasis.opendocument.formula-template', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'oga' => 'audio/ogg', + 'ogex' => 'model/vnd.opengex', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'omdoc' => 'application/omdoc+xml', + 'onepkg' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'opml' => 'text/x-opml', + 'oprc' => 'application/vnd.palm', + 'org' => 'text/x-org', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'osm' => 'application/vnd.openstreetmap.data+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => 'font/otf', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'oti' => 'application/vnd.oasis.opendocument.image-template', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'ova' => 'application/x-virtualbox-ova', + 'ovf' => 'application/x-virtualbox-ovf', + 'owl' => 'application/rdf+xml', + 'oxps' => 'application/oxps', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p' => 'text/x-pascal', + 'p7a' => 'application/x-pkcs7-signature', + 'p7b' => 'application/x-pkcs7-certificates', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'p8' => 'application/pkcs8', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'pac' => 'application/x-ns-proxy-autoconfig', + 'pages' => 'application/vnd.apple.pages', + 'pas' => 'text/x-pascal', + 'paw' => 'application/vnd.pawaafile', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + 'pcap' => 'application/vnd.tcpdump.pcap', + 'pcf' => 'application/x-font-pcf', + 'pcl' => 'application/vnd.hp-pcl', + 'pclxl' => 'application/vnd.hp-pclxl', + 'pct' => 'image/x-pict', + 'pcurl' => 'application/vnd.curl.pcurl', + 'pcx' => 'image/x-pcx', + 'pdb' => 'application/x-pilot', + 'pde' => 'text/x-processing', + 'pdf' => 'application/pdf', + 'pem' => 'application/x-x509-user-cert', + 'pfa' => 'application/x-font-type1', + 'pfb' => 'application/x-font-type1', + 'pfm' => 'application/x-font-type1', + 'pfr' => 'application/font-tdpfr', + 'pfx' => 'application/x-pkcs12', + 'pgm' => 'image/x-portable-graymap', + 'pgn' => 'application/x-chess-pgn', + 'pgp' => 'application/pgp', + 'php' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'phtml' => 'application/x-httpd-php', + 'pic' => 'image/x-pict', + 'pkg' => 'application/octet-stream', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'pkpass' => 'application/vnd.apple.pkpass', + 'pl' => 'application/x-perl', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + 'pm' => 'application/x-perl', + 'pml' => 'application/vnd.ctc-posml', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'portpkg' => 'application/vnd.macports.portpkg', + 'pot' => 'application/vnd.ms-powerpoint', + 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'ppd' => 'application/vnd.cups-ppd', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/vnd.ms-powerpoint', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppt' => 'application/powerpoint', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pqa' => 'application/vnd.palm', + 'prc' => 'application/x-pilot', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'provx' => 'application/provenance+xml', + 'ps' => 'application/postscript', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'application/x-photoshop', + 'psf' => 'application/x-font-linux-psf', + 'pskcxml' => 'application/pskc+xml', + 'pti' => 'image/prs.pti', + 'ptid' => 'application/vnd.pvi.ptid1', + 'pub' => 'application/x-mspublisher', + 'pvb' => 'application/vnd.3gpp.pic-bw-var', + 'pwn' => 'application/vnd.3m.post-it-notes', + 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyv' => 'video/vnd.ms-playready.media.pyv', + 'qam' => 'application/vnd.epson.quickanime', + 'qbo' => 'application/vnd.intu.qbo', + 'qfx' => 'application/vnd.intu.qfx', + 'qps' => 'application/vnd.publishare-delta-tree', + 'qt' => 'video/quicktime', + 'qwd' => 'application/vnd.quark.quarkxpress', + 'qwt' => 'application/vnd.quark.quarkxpress', + 'qxb' => 'application/vnd.quark.quarkxpress', + 'qxd' => 'application/vnd.quark.quarkxpress', + 'qxl' => 'application/vnd.quark.quarkxpress', + 'qxt' => 'application/vnd.quark.quarkxpress', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'raml' => 'application/raml+yaml', + 'rapd' => 'application/route-apd+xml', + 'rar' => 'application/x-rar', + 'ras' => 'image/x-cmu-raster', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'relo' => 'application/p2p-overlay+xml', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rip' => 'audio/vnd.rip', + 'ris' => 'application/x-research-info-systems', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/midi', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rmvb' => 'application/vnd.rn-realmedia-vbr', + 'rnc' => 'application/relax-ng-compact-syntax', + 'rng' => 'application/xml', + 'roa' => 'application/rpki-roa', + 'roff' => 'text/troff', + 'rp9' => 'application/vnd.cloanto.rp9', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsa' => 'application/x-pkcs7', + 'rsat' => 'application/atsc-rsat+xml', + 'rsd' => 'application/rsd+xml', + 'rsheet' => 'application/urc-ressheet+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'run' => 'application/x-makeself', + 'rusd' => 'application/route-usd+xml', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saf' => 'application/vnd.yamaha.smaf-audio', + 'sass' => 'text/x-sass', + 'sbml' => 'application/sbml+xml', + 'sc' => 'application/vnd.ibm.secure-container', + 'scd' => 'application/x-msschedule', + 'scm' => 'application/vnd.lotus-screencam', + 'scq' => 'application/scvp-cv-request', + 'scs' => 'application/scvp-cv-response', + 'scss' => 'text/x-scss', + 'scurl' => 'text/vnd.curl.scurl', + 'sda' => 'application/vnd.stardivision.draw', + 'sdc' => 'application/vnd.stardivision.calc', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdkd' => 'application/vnd.solent.sdkm+xml', + 'sdkm' => 'application/vnd.solent.sdkm+xml', + 'sdp' => 'application/sdp', + 'sdw' => 'application/vnd.stardivision.writer', + 'sea' => 'application/octet-stream', + 'see' => 'application/vnd.seemail', + 'seed' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + 'senmlx' => 'application/senml+xml', + 'sensmlx' => 'application/sensml+xml', + 'ser' => 'application/java-serialized-object', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', + 'sfs' => 'application/vnd.spotfire.sfs', + 'sfv' => 'text/x-sfv', + 'sgi' => 'image/sgi', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shex' => 'text/shex', + 'shf' => 'application/shf+xml', + 'shtml' => 'text/html', + 'sid' => 'image/x-mrsid-image', + 'sieve' => 'application/sieve', + 'sig' => 'application/pgp-signature', + 'sil' => 'audio/silk', + 'silo' => 'model/mesh', + 'sis' => 'application/vnd.symbian.install', + 'sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + 'siv' => 'application/sieve', + 'skd' => 'application/vnd.koan', + 'skm' => 'application/vnd.koan', + 'skp' => 'application/vnd.koan', + 'skt' => 'application/vnd.koan', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'slim' => 'text/slim', + 'slm' => 'text/slim', + 'sls' => 'application/route-s-tsid+xml', + 'slt' => 'application/vnd.epson.salt', + 'sm' => 'application/vnd.stepmania.stepchart', + 'smf' => 'application/vnd.stardivision.math', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'smv' => 'video/x-smv', + 'smzip' => 'application/vnd.stepmania.package', + 'snd' => 'audio/basic', + 'snf' => 'application/x-font-snf', + 'so' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + 'spdx' => 'text/spdx', + 'spf' => 'application/vnd.yamaha.smaf-phrase', + 'spl' => 'application/x-futuresplash', + 'spot' => 'text/vnd.in3d.spot', + 'spp' => 'application/scvp-vp-response', + 'spq' => 'application/scvp-vp-request', + 'spx' => 'audio/ogg', + 'sql' => 'application/x-sql', + 'src' => 'application/x-wais-source', + 'srt' => 'application/x-subrip', + 'sru' => 'application/sru+xml', + 'srx' => 'application/sparql-results+xml', + 'ssdl' => 'application/ssdl+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'sst' => 'application/octet-stream', + 'st' => 'application/vnd.sailingtracker.track', + 'stc' => 'application/vnd.sun.xml.calc.template', + 'std' => 'application/vnd.sun.xml.draw.template', + 'stf' => 'application/vnd.wt.stf', + 'sti' => 'application/vnd.sun.xml.impress.template', + 'stk' => 'application/hyperstudio', + 'stl' => 'model/stl', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'styl' => 'text/stylus', + 'stylus' => 'text/stylus', + 'sub' => 'text/vnd.dvb.subtitle', + 'sus' => 'application/vnd.sus-calendar', + 'susp' => 'application/vnd.sus-calendar', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svc' => 'application/vnd.dvb.service', + 'svd' => 'application/vnd.svd', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swa' => 'application/x-director', + 'swf' => 'application/x-shockwave-flash', + 'swi' => 'application/vnd.aristanetworks.swi', + 'swidtag' => 'application/swid+xml', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 't' => 'text/troff', + 't3' => 'application/x-t3vm-image', + 't38' => 'image/t38', + 'taglet' => 'application/vnd.mynfc', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tap' => 'image/vnd.tencent.tap', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + 'td' => 'application/urc-targetdesc+xml', + 'teacher' => 'application/vnd.smart.teacher', + 'tei' => 'application/tei+xml', + 'teicorpus' => 'application/tei+xml', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tfi' => 'application/thraud+xml', + 'tfm' => 'application/x-tex-tfm', + 'tfx' => 'image/tiff-fx', + 'tga' => 'image/x-tga', + 'tgz' => 'application/x-tar', + 'thmx' => 'application/vnd.ms-officetheme', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tk' => 'application/x-tcl', + 'tmo' => 'application/vnd.tmobile-livetv', + 'toml' => 'application/toml', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tr' => 'text/troff', + 'tra' => 'application/vnd.trueapp', + 'trm' => 'application/x-msterminal', + 'ts' => 'video/mp2t', + 'tsd' => 'application/timestamped-data', + 'tsv' => 'text/tab-separated-values', + 'ttc' => 'font/collection', + 'ttf' => 'font/ttf', + 'ttl' => 'text/turtle', + 'ttml' => 'application/ttml+xml', + 'twd' => 'application/vnd.simtech-mindmapper', + 'twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt' => 'text/plain', + 'u8dsn' => 'message/global-delivery-status', + 'u8hdr' => 'message/global-headers', + 'u8mdn' => 'message/global-disposition-notification', + 'u8msg' => 'message/global', + 'u32' => 'application/x-authorware-bin', + 'ubj' => 'application/ubjson', + 'udeb' => 'application/x-debian-package', + 'ufd' => 'application/vnd.ufdl', + 'ufdl' => 'application/vnd.ufdl', + 'ulx' => 'application/x-glulx', + 'umj' => 'application/vnd.umajin', + 'unityweb' => 'application/vnd.unity', + 'uoml' => 'application/vnd.uoml+xml', + 'uri' => 'text/uri-list', + 'uris' => 'text/uri-list', + 'urls' => 'text/uri-list', + 'usdz' => 'model/vnd.usdz+zip', + 'ustar' => 'application/x-ustar', + 'utz' => 'application/vnd.uiq.theme', + 'uu' => 'text/x-uuencode', + 'uva' => 'audio/vnd.dece.audio', + 'uvd' => 'application/vnd.dece.data', + 'uvf' => 'application/vnd.dece.data', + 'uvg' => 'image/vnd.dece.graphic', + 'uvh' => 'video/vnd.dece.hd', + 'uvi' => 'image/vnd.dece.graphic', + 'uvm' => 'video/vnd.dece.mobile', + 'uvp' => 'video/vnd.dece.pd', + 'uvs' => 'video/vnd.dece.sd', + 'uvt' => 'application/vnd.dece.ttml+xml', + 'uvu' => 'video/vnd.uvvu.mp4', + 'uvv' => 'video/vnd.dece.video', + 'uvva' => 'audio/vnd.dece.audio', + 'uvvd' => 'application/vnd.dece.data', + 'uvvf' => 'application/vnd.dece.data', + 'uvvg' => 'image/vnd.dece.graphic', + 'uvvh' => 'video/vnd.dece.hd', + 'uvvi' => 'image/vnd.dece.graphic', + 'uvvm' => 'video/vnd.dece.mobile', + 'uvvp' => 'video/vnd.dece.pd', + 'uvvs' => 'video/vnd.dece.sd', + 'uvvt' => 'application/vnd.dece.ttml+xml', + 'uvvu' => 'video/vnd.uvvu.mp4', + 'uvvv' => 'video/vnd.dece.video', + 'uvvx' => 'application/vnd.dece.unspecified', + 'uvvz' => 'application/vnd.dece.zip', + 'uvx' => 'application/vnd.dece.unspecified', + 'uvz' => 'application/vnd.dece.zip', + 'vbox' => 'application/x-virtualbox-vbox', + 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', + 'vcard' => 'text/vcard', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vdi' => 'application/x-virtualbox-vdi', + 'vhd' => 'application/x-virtualbox-vhd', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + 'vlc' => 'application/videolan', + 'vmdk' => 'application/x-virtualbox-vmdk', + 'vob' => 'video/x-ms-vob', + 'vor' => 'application/vnd.stardivision.writer', + 'vox' => 'application/x-authorware-bin', + 'vrml' => 'model/vrml', + 'vsd' => 'application/vnd.visio', + 'vsf' => 'application/vnd.vsf', + 'vss' => 'application/vnd.visio', + 'vst' => 'application/vnd.visio', + 'vsw' => 'application/vnd.visio', + 'vtf' => 'image/vnd.valve.source.texture', + 'vtt' => 'text/vtt', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'w3d' => 'application/x-director', + 'wad' => 'application/x-doom', + 'wadl' => 'application/vnd.sun.wadl+xml', + 'war' => 'application/java-archive', + 'wasm' => 'application/wasm', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/wbxml', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'wdp' => 'image/vnd.ms-photo', + 'weba' => 'audio/webm', + 'webapp' => 'application/x-web-app-manifest+json', + 'webm' => 'video/webm', + 'webmanifest' => 'application/manifest+json', + 'webp' => 'image/webp', + 'wg' => 'application/vnd.pmi.widget', + 'wgt' => 'application/widget', + 'wks' => 'application/vnd.ms-works', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'image/wmf', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-msmetafile', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', + 'word' => 'application/msword', + 'wpd' => 'application/vnd.wordperfect', + 'wpl' => 'application/vnd.ms-wpl', + 'wps' => 'application/vnd.ms-works', + 'wqd' => 'application/vnd.wqd', + 'wri' => 'application/x-mswrite', + 'wrl' => 'model/vrml', + 'wsc' => 'message/vnd.wfa.wsc', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x3d' => 'model/x3d+xml', + 'x3db' => 'model/x3d+fastinfoset', + 'x3dbz' => 'model/x3d+binary', + 'x3dv' => 'model/x3d-vrml', + 'x3dvz' => 'model/x3d+vrml', + 'x3dz' => 'model/x3d+xml', + 'x32' => 'application/x-authorware-bin', + 'x_b' => 'model/vnd.parasolid.transmit.binary', + 'x_t' => 'model/vnd.parasolid.transmit.text', + 'xaml' => 'application/xaml+xml', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xav' => 'application/xcap-att+xml', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + 'xca' => 'application/xcap-caps+xml', + 'xcs' => 'application/calendar+xml', + 'xdf' => 'application/xcap-diff+xml', + 'xdm' => 'application/vnd.syncml.dm+xml', + 'xdp' => 'application/vnd.adobe.xdp+xml', + 'xdssc' => 'application/dssc+xml', + 'xdw' => 'application/vnd.fujixerox.docuworks', + 'xel' => 'application/xcap-el+xml', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/xcap-error+xml', + 'xfdf' => 'application/vnd.adobe.xfdf', + 'xfdl' => 'application/vnd.xfdl', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'xhvml' => 'application/xv+xml', + 'xif' => 'image/vnd.xiff', + 'xl' => 'application/excel', + 'xla' => 'application/vnd.ms-excel', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlc' => 'application/vnd.ms-excel', + 'xlf' => 'application/xliff+xml', + 'xlm' => 'application/vnd.ms-excel', + 'xls' => 'application/vnd.ms-excel', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlt' => 'application/vnd.ms-excel', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xlw' => 'application/vnd.ms-excel', + 'xm' => 'audio/xm', + 'xml' => 'application/xml', + 'xns' => 'application/xcap-ns+xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpl' => 'application/xproc+xml', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + 'xpw' => 'application/vnd.intercon.formnet', + 'xpx' => 'application/vnd.intercon.formnet', + 'xsd' => 'application/xml', + 'xsl' => 'application/xml', + 'xslt' => 'application/xslt+xml', + 'xsm' => 'application/vnd.syncml+xml', + 'xspf' => 'application/xspf+xml', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xvm' => 'application/xv+xml', + 'xvml' => 'application/xv+xml', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-xyz', + 'xz' => 'application/x-xz', + 'yaml' => 'text/yaml', + 'yang' => 'application/yang', + 'yin' => 'application/yin+xml', + 'yml' => 'text/yaml', + 'ymp' => 'text/x-suse-ymp', + 'z' => 'application/x-compress', + 'z1' => 'application/x-zmachine', + 'z2' => 'application/x-zmachine', + 'z3' => 'application/x-zmachine', + 'z4' => 'application/x-zmachine', + 'z5' => 'application/x-zmachine', + 'z6' => 'application/x-zmachine', + 'z7' => 'application/x-zmachine', + 'z8' => 'application/x-zmachine', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/x-zip', + 'zir' => 'application/vnd.zul', + 'zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml', + 'zsh' => 'text/x-scriptzsh', + ]; + + public function lookupMimeType(string $extension): ?string + { + return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null; + } +} diff --git a/application/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/application/vendor/league/mime-type-detection/src/MimeTypeDetector.php new file mode 100644 index 0000000..5d799d2 --- /dev/null +++ b/application/vendor/league/mime-type-detection/src/MimeTypeDetector.php @@ -0,0 +1,19 @@ +getTimestamp(), $message)); + return Utils::jsonEncode(array($tag, $record['datetime']->getTimestamp(), $message)); } public function formatBatch(array $records) diff --git a/application/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/application/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php index dfc0b4a..9e8d2d0 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +++ b/application/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php @@ -11,6 +11,7 @@ namespace Monolog\Formatter; use Monolog\Logger; +use Monolog\Utils; /** * Formats incoming records into an HTML table @@ -133,9 +134,9 @@ protected function convertToString($data) $data = $this->normalize($data); if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + return Utils::jsonEncode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, true); } - return str_replace('\\/', '/', json_encode($data)); + return str_replace('\\/', '/', Utils::jsonEncode($data, null, true)); } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/application/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index 2ff119e..86966b0 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/application/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -145,7 +145,7 @@ protected function normalize($data, $depth = 0) return 'Over 9 levels deep, aborting normalization'; } - if (is_array($data) || $data instanceof \Traversable) { + if (is_array($data)) { $normalized = array(); $count = 1; @@ -165,6 +165,10 @@ protected function normalize($data, $depth = 0) return $this->normalizeException($data); } + if (is_resource($data)) { + return parent::normalize($data); + } + return $data; } @@ -186,7 +190,7 @@ protected function normalizeException($e) $data = array( 'class' => Utils::getClass($e), 'message' => $e->getMessage(), - 'code' => $e->getCode(), + 'code' => (int) $e->getCode(), 'file' => $e->getFile().':'.$e->getLine(), ); diff --git a/application/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/application/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index f98e1a6..acc1fd3 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/application/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -163,7 +163,7 @@ protected function convertToString($data) return $this->toJson($data, true); } - return str_replace('\\/', '/', @json_encode($data)); + return str_replace('\\/', '/', $this->toJson($data, true)); } protected function replaceNewlines($str) diff --git a/application/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/application/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php index eb7be84..bd9e4c0 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +++ b/application/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php @@ -87,7 +87,7 @@ protected function formatException(\Exception $exception, $nestingLevel) $formattedException = array( 'class' => Utils::getClass($exception), 'message' => $exception->getMessage(), - 'code' => $exception->getCode(), + 'code' => (int) $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine(), ); diff --git a/application/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/application/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 9865394..3a01f2c 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/application/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -129,7 +129,7 @@ protected function normalizeException($e) $data = array( 'class' => Utils::getClass($e), 'message' => $e->getMessage(), - 'code' => $e->getCode(), + 'code' => (int) $e->getCode(), 'file' => $e->getFile().':'.$e->getLine(), ); @@ -143,7 +143,11 @@ protected function normalizeException($e) } if (isset($e->detail)) { - $data['detail'] = $e->detail; + if (is_string($e->detail)) { + $data['detail'] = $e->detail; + } elseif (is_object($e->detail) || is_array($e->detail)) { + $data['detail'] = $this->toJson($e->detail, true); + } } } @@ -171,127 +175,6 @@ protected function normalizeException($e) */ protected function toJson($data, $ignoreErrors = false) { - // suppress json_encode errors since it's twitchy with some inputs - if ($ignoreErrors) { - return @$this->jsonEncode($data); - } - - $json = $this->jsonEncode($data); - - if ($json === false) { - $json = $this->handleJsonError(json_last_error(), $data); - } - - return $json; - } - - /** - * @param mixed $data - * @return string JSON encoded data or null on failure - */ - private function jsonEncode($data) - { - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - return json_encode($data); - } - - /** - * Handle a json_encode failure. - * - * If the failure is due to invalid string encoding, try to clean the - * input and encode again. If the second encoding attempt fails, the - * inital error is not encoding related or the input can't be cleaned then - * raise a descriptive exception. - * - * @param int $code return code of json_last_error function - * @param mixed $data data that was meant to be encoded - * @throws \RuntimeException if failure can't be corrected - * @return string JSON encoded data after error correction - */ - private function handleJsonError($code, $data) - { - if ($code !== JSON_ERROR_UTF8) { - $this->throwEncodeError($code, $data); - } - - if (is_string($data)) { - $this->detectAndCleanUtf8($data); - } elseif (is_array($data)) { - array_walk_recursive($data, array($this, 'detectAndCleanUtf8')); - } else { - $this->throwEncodeError($code, $data); - } - - $json = $this->jsonEncode($data); - - if ($json === false) { - $this->throwEncodeError(json_last_error(), $data); - } - - return $json; - } - - /** - * Throws an exception according to a given code with a customized message - * - * @param int $code return code of json_last_error function - * @param mixed $data data that was meant to be encoded - * @throws \RuntimeException - */ - private function throwEncodeError($code, $data) - { - switch ($code) { - case JSON_ERROR_DEPTH: - $msg = 'Maximum stack depth exceeded'; - break; - case JSON_ERROR_STATE_MISMATCH: - $msg = 'Underflow or the modes mismatch'; - break; - case JSON_ERROR_CTRL_CHAR: - $msg = 'Unexpected control character found'; - break; - case JSON_ERROR_UTF8: - $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; - break; - default: - $msg = 'Unknown error'; - } - - throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); - } - - /** - * Detect invalid UTF-8 string characters and convert to valid UTF-8. - * - * Valid UTF-8 input will be left unmodified, but strings containing - * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed - * original encoding of ISO-8859-15. This conversion may result in - * incorrect output if the actual encoding was not ISO-8859-15, but it - * will be clean UTF-8 output and will not rely on expensive and fragile - * detection algorithms. - * - * Function converts the input in place in the passed variable so that it - * can be used as a callback for array_walk_recursive. - * - * @param mixed &$data Input to check and convert if needed - * @private - */ - public function detectAndCleanUtf8(&$data) - { - if (is_string($data) && !preg_match('//u', $data)) { - $data = preg_replace_callback( - '/[\x80-\xFF]+/', - function ($m) { return utf8_encode($m[0]); }, - $data - ); - $data = str_replace( - array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), - array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), - $data - ); - } + return Utils::jsonEncode($data, null, $ignoreErrors); } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php index 92b9d45..cdd9f7d 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php @@ -33,8 +33,8 @@ abstract class AbstractHandler implements HandlerInterface, ResettableInterface protected $processors = array(); /** - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|string $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not */ public function __construct($level = Logger::DEBUG, $bubble = true) { diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 23cf23b..68feb48 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -164,21 +164,22 @@ private static function generateScript() private static function handleStyles($formatted) { - $args = array(static::quote('font-weight: normal')); + $args = array(); $format = '%c' . $formatted; preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); foreach (array_reverse($matches) as $match) { - $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); $args[] = '"font-weight: normal"'; + $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); $pos = $match[0][1]; $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0])); } - array_unshift($args, static::quote($format)); + $args[] = static::quote('font-weight: normal'); + $args[] = static::quote($format); - return $args; + return array_reverse($args); } private static function handleCustomStyles($style, $string) diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php index 61d1b50..0957e55 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php @@ -13,6 +13,7 @@ use Monolog\Logger; use Monolog\ResettableInterface; +use Monolog\Formatter\FormatterInterface; /** * Buffers all records until closing the handler and then pass them as batch. @@ -126,4 +127,22 @@ public function reset() $this->handler->reset(); } } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->handler->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->handler->getFormatter(); + } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php index ac98d5d..47120e5 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php @@ -13,6 +13,7 @@ use Monolog\Formatter\ChromePHPFormatter; use Monolog\Logger; +use Monolog\Utils; /** * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) @@ -134,7 +135,7 @@ protected function send() self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; } - $json = @json_encode(self::$json); + $json = Utils::jsonEncode(self::$json, null, true); $data = base64_encode(utf8_encode($json)); if (strlen($data) > 3 * 1024) { self::$overflowed = true; @@ -149,7 +150,7 @@ protected function send() 'extra' => array(), ); self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); - $json = @json_encode(self::$json); + $json = Utils::jsonEncode(self::$json, null, true); $data = base64_encode(utf8_encode($json)); } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php index 96b3ca0..44928ef 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Utils; /** * Logs to Cube. @@ -119,9 +120,9 @@ protected function write(array $record) $data['data']['level'] = $record['level']; if ($this->scheme === 'http') { - $this->writeHttp(json_encode($data)); + $this->writeHttp(Utils::jsonEncode($data)); } else { - $this->writeUdp(json_encode($data)); + $this->writeUdp(Utils::jsonEncode($data)); } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php index 938c1a7..949f227 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Formatter\FormatterInterface; /** * Simple handler wrapper that filters records based on a list of levels @@ -45,7 +46,7 @@ class FilterHandler extends AbstractHandler protected $bubble; /** - * @param callable|HandlerInterface $handler Handler or factory callable($record, $this). + * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler). * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array * @param bool $bubble Whether the messages that are handled can bubble up the stack or not @@ -104,21 +105,13 @@ public function handle(array $record) return false; } - // The same logic as in FingersCrossedHandler - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - if ($this->processors) { foreach ($this->processors as $processor) { $record = call_user_func($processor, $record); } } - $this->handler->handle($record); + $this->getHandler($record)->handle($record); return false === $this->bubble; } @@ -135,6 +128,45 @@ public function handleBatch(array $records) } } - $this->handler->handleBatch($filtered); + if (count($filtered) > 0) { + $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered); + } + } + + /** + * Return the nested handler + * + * If the handler was provided as a factory callable, this will trigger the handler's instantiation. + * + * @return HandlerInterface + */ + public function getHandler(array $record = null) + { + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + return $this->handler; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->getHandler()->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->getHandler()->getFormatter(); } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php index 275fd51..cdabc44 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -15,6 +15,7 @@ use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; use Monolog\Logger; use Monolog\ResettableInterface; +use Monolog\Formatter\FormatterInterface; /** * Buffers all records until a certain level is reached @@ -39,7 +40,7 @@ class FingersCrossedHandler extends AbstractHandler protected $passthruLevel; /** - * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). + * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler). * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. * @param bool $bubble Whether the messages that are handled can bubble up the stack or not @@ -88,15 +89,7 @@ public function activate() if ($this->stopBuffering) { $this->buffering = false; } - if (!$this->handler instanceof HandlerInterface) { - $record = end($this->buffer) ?: null; - - $this->handler = call_user_func($this->handler, $record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - $this->handler->handleBatch($this->buffer); + $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); $this->buffer = array(); } @@ -120,7 +113,7 @@ public function handle(array $record) $this->activate(); } } else { - $this->handler->handle($record); + $this->getHandler($record)->handle($record); } return false === $this->bubble; @@ -140,8 +133,8 @@ public function reset() parent::reset(); - if ($this->handler instanceof ResettableInterface) { - $this->handler->reset(); + if ($this->getHandler() instanceof ResettableInterface) { + $this->getHandler()->reset(); } } @@ -167,11 +160,48 @@ private function flushBuffer() return $record['level'] >= $level; }); if (count($this->buffer) > 0) { - $this->handler->handleBatch($this->buffer); + $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); } } $this->buffer = array(); $this->buffering = true; } + + /** + * Return the nested handler + * + * If the handler was provided as a factory callable, this will trigger the handler's instantiation. + * + * @return HandlerInterface + */ + public function getHandler(array $record = null) + { + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + return $this->handler; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->getHandler()->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->getHandler()->getFormatter(); + } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php index dd9a361..f0f010c 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Utils; use Monolog\Formatter\FlowdockFormatter; use Monolog\Formatter\FormatterInterface; @@ -105,7 +106,7 @@ protected function generateDataStream($record) */ private function buildContent($record) { - return json_encode($record['formatted']['flowdock']); + return Utils::jsonEncode($record['formatted']['flowdock']); } /** diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php index 7f22622..f4d3b97 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Utils; /** * IFTTTHandler uses cURL to trigger IFTTT Maker actions @@ -53,7 +54,7 @@ public function write(array $record) "value2" => $record["level_name"], "value3" => $record["message"], ); - $postString = json_encode($postData); + $postString = Utils::jsonEncode($postData); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey); diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php index f911997..64dc138 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Utils; use Monolog\Formatter\NormalizerFormatter; /** @@ -190,7 +191,7 @@ protected function setNewRelicParameter($key, $value) if (null === $value || is_scalar($value)) { newrelic_add_custom_parameter($key, $value); } else { - newrelic_add_custom_parameter($key, @json_encode($value)); + newrelic_add_custom_parameter($key, Utils::jsonEncode($value, null, true)); } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php index 1f2076a..d0a8b43 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php @@ -14,6 +14,7 @@ use Exception; use Monolog\Formatter\LineFormatter; use Monolog\Logger; +use Monolog\Utils; use PhpConsole\Connector; use PhpConsole\Handler; use PhpConsole\Helper; @@ -188,7 +189,7 @@ private function handleDebugRecord(array $record) $tags = $this->getRecordTags($record); $message = $record['message']; if ($record['context']) { - $message .= ' ' . json_encode($this->connector->getDumper()->dump(array_filter($record['context']))); + $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true); } $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']); } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php index 1929f25..9d24dfe 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -86,7 +86,7 @@ public function handleBatch(array $records) // the record with the highest severity is the "main" one $record = array_reduce($records, function ($highest, $record) { - if ($record['level'] > $highest['level']) { + if (null === $highest || $record['level'] > $highest['level']) { return $record; } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php index 590f996..bb00db5 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php @@ -73,7 +73,8 @@ protected function write(array $record) protected function writeCapped(array $record) { if ($this->redisClient instanceof \Redis) { - $this->redisClient->multi() + $mode = defined('\Redis::MULTI') ? \Redis::MULTI : 1; + $this->redisClient->multi($mode) ->rpush($this->redisKey, $record["formatted"]) ->ltrim($this->redisKey, -$this->capSize, -1) ->exec(); diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php index ae2309f..b8253ba 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Utils; /** * Stores logs to files that are rotated every day and a limited number of files are kept. @@ -45,7 +46,7 @@ class RotatingFileHandler extends StreamHandler */ public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) { - $this->filename = $filename; + $this->filename = Utils::canonicalizePath($filename); $this->maxFiles = (int) $maxFiles; $this->nextRotation = new \DateTime('tomorrow'); $this->filenameFormat = '{filename}-{date}'; diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php index 9509ae3..b547ed7 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -11,6 +11,8 @@ namespace Monolog\Handler; +use Monolog\Formatter\FormatterInterface; + /** * Sampling handler * @@ -38,7 +40,7 @@ class SamplingHandler extends AbstractHandler protected $factor; /** - * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). + * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler). * @param int $factor Sample factor */ public function __construct($handler, $factor) @@ -54,29 +56,58 @@ public function __construct($handler, $factor) public function isHandling(array $record) { - return $this->handler->isHandling($record); + return $this->getHandler($record)->isHandling($record); } public function handle(array $record) { if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { - // The same logic as in FingersCrossedHandler - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - if ($this->processors) { foreach ($this->processors as $processor) { $record = call_user_func($processor, $record); } } - $this->handler->handle($record); + $this->getHandler($record)->handle($record); } return false === $this->bubble; } + + /** + * Return the nested handler + * + * If the handler was provided as a factory callable, this will trigger the handler's instantiation. + * + * @return HandlerInterface + */ + public function getHandler(array $record = null) + { + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + return $this->handler; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->getHandler()->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->getHandler()->getFormatter(); + } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/application/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index e55e0e2..3945550 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -12,6 +12,7 @@ namespace Monolog\Handler\Slack; use Monolog\Logger; +use Monolog\Utils; use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\FormatterInterface; @@ -207,13 +208,17 @@ public function stringify($fields) { $normalized = $this->normalizerFormatter->format($fields); $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; + $flags = 0; + if (PHP_VERSION_ID >= 50400) { + $flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } $hasSecondDimension = count(array_filter($normalized, 'is_array')); $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); return $hasSecondDimension || $hasNonNumericKeys - ? json_encode($normalized, $prettyPrintFlag) - : json_encode($normalized); + ? Utils::jsonEncode($normalized, $prettyPrintFlag | $flags) + : Utils::jsonEncode($normalized, $flags); } /** diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index 45d634f..88c4c4d 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -13,6 +13,7 @@ use Monolog\Formatter\FormatterInterface; use Monolog\Logger; +use Monolog\Utils; use Monolog\Handler\Slack\SlackRecord; /** @@ -118,7 +119,7 @@ protected function prepareContentData($record) $dataArray['token'] = $this->token; if (!empty($dataArray['attachments'])) { - $dataArray['attachments'] = json_encode($dataArray['attachments']); + $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']); } return $dataArray; diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php index 1ef85fa..b87be99 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -13,6 +13,7 @@ use Monolog\Formatter\FormatterInterface; use Monolog\Logger; +use Monolog\Utils; use Monolog\Handler\Slack\SlackRecord; /** @@ -83,7 +84,7 @@ public function getWebhookUrl() protected function write(array $record) { $postData = $this->slackRecord->getSlackData($record); - $postString = json_encode($postData); + $postString = Utils::jsonEncode($postData); $ch = curl_init(); $options = array( diff --git a/application/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/application/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index 27d90e0..b52607d 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/application/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Monolog\Utils; /** * Stores to any stream resource @@ -45,7 +46,7 @@ public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $fi if (is_resource($stream)) { $this->stream = $stream; } elseif (is_string($stream)) { - $this->url = $stream; + $this->url = Utils::canonicalizePath($stream); } else { throw new \InvalidArgumentException('A stream must either be a resource or a string.'); } @@ -105,7 +106,8 @@ protected function write(array $record) restore_error_handler(); if (!is_resource($this->stream)) { $this->stream = null; - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url)); + + throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $this->url)); } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Logger.php b/application/vendor/monolog/monolog/src/Monolog/Logger.php index 05dfc81..e649af5 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/application/vendor/monolog/monolog/src/Monolog/Logger.php @@ -527,8 +527,13 @@ public static function getLevelName($level) */ public static function toMonologLevel($level) { - if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) { - return constant(__CLASS__.'::'.strtoupper($level)); + if (is_string($level)) { + // Contains chars of all log levels and avoids using strtoupper() which may have + // strange results depending on locale (for example, "i" will become "İ") + $upper = strtr($level, 'abcdefgilmnortuwy', 'ABCDEFGILMNORTUWY'); + if (defined(__CLASS__.'::'.$upper)) { + return constant(__CLASS__ . '::' . $upper); + } } return $level; diff --git a/application/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/application/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php index 9fc3f50..cdf5ec7 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +++ b/application/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php @@ -52,7 +52,7 @@ private static function getGitInfo() } $branches = `git branch -v --no-abbrev`; - if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { + if ($branches && preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { return self::$cache = array( 'branch' => $matches[1], 'commit' => $matches[2], diff --git a/application/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/application/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php index 684188f..2e8dfae 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ b/application/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -52,6 +52,10 @@ public function __construct($serverData = null, array $extraFields = null) throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); } + if (isset($this->serverData['UNIQUE_ID'])) { + $this->extraFields['unique_id'] = 'UNIQUE_ID'; + } + if (null !== $extraFields) { if (isset($extraFields[0])) { foreach (array_keys($this->extraFields) as $fieldName) { @@ -104,10 +108,6 @@ private function appendExtraFields(array $extra) $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null; } - if (isset($this->serverData['UNIQUE_ID'])) { - $extra['unique_id'] = $this->serverData['UNIQUE_ID']; - } - return $extra; } } diff --git a/application/vendor/monolog/monolog/src/Monolog/Utils.php b/application/vendor/monolog/monolog/src/Monolog/Utils.php index eb9be86..712b196 100644 --- a/application/vendor/monolog/monolog/src/Monolog/Utils.php +++ b/application/vendor/monolog/monolog/src/Monolog/Utils.php @@ -22,4 +22,168 @@ public static function getClass($object) return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class; } + + /** + * Makes sure if a relative path is passed in it is turned into an absolute path + * + * @param string $streamUrl stream URL or path without protocol + * + * @return string + */ + public static function canonicalizePath($streamUrl) + { + $prefix = ''; + if ('file://' === substr($streamUrl, 0, 7)) { + $streamUrl = substr($streamUrl, 7); + $prefix = 'file://'; + } + + // other type of stream, not supported + if (false !== strpos($streamUrl, '://')) { + return $streamUrl; + } + + // already absolute + if (substr($streamUrl, 0, 1) === '/' || substr($streamUrl, 1, 1) === ':' || substr($streamUrl, 0, 2) === '\\\\') { + return $prefix.$streamUrl; + } + + $streamUrl = getcwd() . '/' . $streamUrl; + + return $prefix.$streamUrl; + } + + /** + * Return the JSON representation of a value + * + * @param mixed $data + * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE + * @param bool $ignoreErrors whether to ignore encoding errors or to throw on error, when ignored and the encoding fails, "null" is returned which is valid json for null + * @throws \RuntimeException if encoding fails and errors are not ignored + * @return string + */ + public static function jsonEncode($data, $encodeFlags = null, $ignoreErrors = false) + { + if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) { + $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + if ($ignoreErrors) { + $json = @json_encode($data, $encodeFlags); + if (false === $json) { + return 'null'; + } + + return $json; + } + + $json = json_encode($data, $encodeFlags); + if (false === $json) { + $json = self::handleJsonError(json_last_error(), $data); + } + + return $json; + } + + /** + * Handle a json_encode failure. + * + * If the failure is due to invalid string encoding, try to clean the + * input and encode again. If the second encoding attempt fails, the + * inital error is not encoding related or the input can't be cleaned then + * raise a descriptive exception. + * + * @param int $code return code of json_last_error function + * @param mixed $data data that was meant to be encoded + * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE + * @throws \RuntimeException if failure can't be corrected + * @return string JSON encoded data after error correction + */ + public static function handleJsonError($code, $data, $encodeFlags = null) + { + if ($code !== JSON_ERROR_UTF8) { + self::throwEncodeError($code, $data); + } + + if (is_string($data)) { + self::detectAndCleanUtf8($data); + } elseif (is_array($data)) { + array_walk_recursive($data, array('Monolog\Utils', 'detectAndCleanUtf8')); + } else { + self::throwEncodeError($code, $data); + } + + if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) { + $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + $json = json_encode($data, $encodeFlags); + + if ($json === false) { + self::throwEncodeError(json_last_error(), $data); + } + + return $json; + } + + /** + * Throws an exception according to a given code with a customized message + * + * @param int $code return code of json_last_error function + * @param mixed $data data that was meant to be encoded + * @throws \RuntimeException + */ + private static function throwEncodeError($code, $data) + { + switch ($code) { + case JSON_ERROR_DEPTH: + $msg = 'Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $msg = 'Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $msg = 'Unexpected control character found'; + break; + case JSON_ERROR_UTF8: + $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $msg = 'Unknown error'; + } + + throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); + } + + /** + * Detect invalid UTF-8 string characters and convert to valid UTF-8. + * + * Valid UTF-8 input will be left unmodified, but strings containing + * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed + * original encoding of ISO-8859-15. This conversion may result in + * incorrect output if the actual encoding was not ISO-8859-15, but it + * will be clean UTF-8 output and will not rely on expensive and fragile + * detection algorithms. + * + * Function converts the input in place in the passed variable so that it + * can be used as a callback for array_walk_recursive. + * + * @param mixed &$data Input to check and convert if needed + * @private + */ + public static function detectAndCleanUtf8(&$data) + { + if (is_string($data) && !preg_match('//u', $data)) { + $data = preg_replace_callback( + '/[\x80-\xFF]+/', + function ($m) { return utf8_encode($m[0]); }, + $data + ); + $data = str_replace( + array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), + array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), + $data + ); + } + } } diff --git a/application/vendor/mtdowling/cron-expression/composer.json b/application/vendor/mtdowling/cron-expression/composer.json index ce42d40..d68c9ec 100644 --- a/application/vendor/mtdowling/cron-expression/composer.json +++ b/application/vendor/mtdowling/cron-expression/composer.json @@ -24,5 +24,6 @@ "psr-4": { "Tests\\": "tests/Cron/" } - } -} \ No newline at end of file + }, + "abandoned": "dragonmantank/cron-expression" +} diff --git a/application/vendor/nesbot/carbon/bin/upgrade-carbon b/application/vendor/nesbot/carbon/bin/upgrade-carbon old mode 100644 new mode 100755 diff --git a/application/vendor/nikic/php-parser/bin/php-parse b/application/vendor/nikic/php-parser/bin/php-parse old mode 100644 new mode 100755 diff --git a/application/vendor/nikic/php-parser/test_old/run-php-src.sh b/application/vendor/nikic/php-parser/test_old/run-php-src.sh old mode 100644 new mode 100755 diff --git a/application/vendor/psr/log/.gitignore b/application/vendor/psr/log/.gitignore deleted file mode 100644 index 22d0d82..0000000 --- a/application/vendor/psr/log/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor diff --git a/application/vendor/psr/log/Psr/Log/LoggerInterface.php b/application/vendor/psr/log/Psr/Log/LoggerInterface.php index e695046..2206cfd 100644 --- a/application/vendor/psr/log/Psr/Log/LoggerInterface.php +++ b/application/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -22,8 +22,8 @@ interface LoggerInterface /** * System is unusable. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -35,8 +35,8 @@ public function emergency($message, array $context = array()); * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -47,8 +47,8 @@ public function alert($message, array $context = array()); * * Example: Application component unavailable, unexpected exception. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -58,8 +58,8 @@ public function critical($message, array $context = array()); * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -71,8 +71,8 @@ public function error($message, array $context = array()); * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -81,8 +81,8 @@ public function warning($message, array $context = array()); /** * Normal but significant events. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -93,8 +93,8 @@ public function notice($message, array $context = array()); * * Example: User logs in, SQL logs. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -103,8 +103,8 @@ public function info($message, array $context = array()); /** * Detailed debug information. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -113,9 +113,9 @@ public function debug($message, array $context = array()); /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string $message - * @param array $context + * @param mixed $level + * @param string $message + * @param mixed[] $context * * @return void * diff --git a/application/vendor/psr/log/Psr/Log/Test/DummyTest.php b/application/vendor/psr/log/Psr/Log/Test/DummyTest.php new file mode 100644 index 0000000..9638c11 --- /dev/null +++ b/application/vendor/psr/log/Psr/Log/Test/DummyTest.php @@ -0,0 +1,18 @@ +assertEquals($expected, $this->getLogs()); } } - -class DummyTest -{ - public function __toString() - { - return 'DummyTest'; - } -} diff --git a/application/vendor/psy/psysh/.editorconfig b/application/vendor/psy/psysh/.editorconfig deleted file mode 100644 index 779f99a..0000000 --- a/application/vendor/psy/psysh/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/application/vendor/psy/psysh/bin/build b/application/vendor/psy/psysh/bin/build old mode 100644 new mode 100755 diff --git a/application/vendor/psy/psysh/bin/build-manual b/application/vendor/psy/psysh/bin/build-manual old mode 100644 new mode 100755 diff --git a/application/vendor/psy/psysh/bin/build-phar b/application/vendor/psy/psysh/bin/build-phar old mode 100644 new mode 100755 diff --git a/application/vendor/psy/psysh/bin/build-vendor b/application/vendor/psy/psysh/bin/build-vendor old mode 100644 new mode 100755 diff --git a/application/vendor/psy/psysh/bin/psysh b/application/vendor/psy/psysh/bin/psysh old mode 100644 new mode 100755 diff --git a/application/vendor/psy/psysh/test/tools/gen_unvis_fixtures.py b/application/vendor/psy/psysh/test/tools/gen_unvis_fixtures.py old mode 100644 new mode 100755 diff --git a/application/vendor/psy/psysh/test/tools/vis.py b/application/vendor/psy/psysh/test/tools/vis.py old mode 100644 new mode 100755 diff --git a/application/vendor/services.json b/application/vendor/services.json deleted file mode 100644 index 00d309d..0000000 --- a/application/vendor/services.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "providers": [ - "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "Illuminate\\Auth\\AuthServiceProvider", - "Illuminate\\Bus\\BusServiceProvider", - "Illuminate\\Cache\\CacheServiceProvider", - "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "Illuminate\\Routing\\ControllerServiceProvider", - "Illuminate\\Cookie\\CookieServiceProvider", - "Illuminate\\Database\\DatabaseServiceProvider", - "Illuminate\\Encryption\\EncryptionServiceProvider", - "Illuminate\\Filesystem\\FilesystemServiceProvider", - "Illuminate\\Foundation\\Providers\\FoundationServiceProvider", - "Illuminate\\Hashing\\HashServiceProvider", - "Illuminate\\Mail\\MailServiceProvider", - "Illuminate\\Pagination\\PaginationServiceProvider", - "Illuminate\\Pipeline\\PipelineServiceProvider", - "Illuminate\\Queue\\QueueServiceProvider", - "Illuminate\\Redis\\RedisServiceProvider", - "Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider", - "Illuminate\\Session\\SessionServiceProvider", - "Illuminate\\Translation\\TranslationServiceProvider", - "Illuminate\\Validation\\ValidationServiceProvider", - "Illuminate\\View\\ViewServiceProvider", - "Illuminate\\Html\\HtmlServiceProvider", - "App\\Providers\\AppServiceProvider", - "App\\Providers\\BusServiceProvider", - "App\\Providers\\ConfigServiceProvider", - "App\\Providers\\EventServiceProvider", - "App\\Providers\\RouteServiceProvider", - "App\\Providers\\HelperServiceProvider" - ], - "eager": [ - "Illuminate\\Auth\\AuthServiceProvider", - "Illuminate\\Routing\\ControllerServiceProvider", - "Illuminate\\Cookie\\CookieServiceProvider", - "Illuminate\\Database\\DatabaseServiceProvider", - "Illuminate\\Encryption\\EncryptionServiceProvider", - "Illuminate\\Filesystem\\FilesystemServiceProvider", - "Illuminate\\Foundation\\Providers\\FoundationServiceProvider", - "Illuminate\\Pagination\\PaginationServiceProvider", - "Illuminate\\Session\\SessionServiceProvider", - "Illuminate\\Validation\\ValidationServiceProvider", - "Illuminate\\View\\ViewServiceProvider", - "App\\Providers\\AppServiceProvider", - "App\\Providers\\BusServiceProvider", - "App\\Providers\\ConfigServiceProvider", - "App\\Providers\\EventServiceProvider", - "App\\Providers\\RouteServiceProvider", - "App\\Providers\\HelperServiceProvider" - ], - "deferred": { - "command.app.name": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.clear-compiled": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.command.make": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.config.cache": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.config.clear": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.console.make": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.event.generate": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.event.make": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.down": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.environment": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.fresh": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.handler.command": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.handler.event": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.key.generate": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.model.make": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.optimize": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.provider.make": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.request.make": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.route.cache": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.route.clear": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.route.list": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.serve": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.tinker": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.up": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "command.vendor.publish": "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider", - "Illuminate\\Bus\\Dispatcher": "Illuminate\\Bus\\BusServiceProvider", - "Illuminate\\Contracts\\Bus\\Dispatcher": "Illuminate\\Bus\\BusServiceProvider", - "Illuminate\\Contracts\\Bus\\QueueingDispatcher": "Illuminate\\Bus\\BusServiceProvider", - "cache": "Illuminate\\Cache\\CacheServiceProvider", - "cache.store": "Illuminate\\Cache\\CacheServiceProvider", - "memcached.connector": "Illuminate\\Cache\\CacheServiceProvider", - "command.cache.clear": "Illuminate\\Cache\\CacheServiceProvider", - "command.cache.table": "Illuminate\\Cache\\CacheServiceProvider", - "command.auth.resets.clear": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "Illuminate\\Console\\Scheduling\\ScheduleRunCommand": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "migrator": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "migration.repository": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate.rollback": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate.reset": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate.refresh": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate.install": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate.status": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "migration.creator": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.migrate.make": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "seeder": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.seed": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "composer": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.queue.table": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.queue.failed": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.queue.retry": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.queue.forget": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.queue.flush": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.queue.failed-table": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.controller.make": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.middleware.make": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "command.session.database": "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider", - "hash": "Illuminate\\Hashing\\HashServiceProvider", - "mailer": "Illuminate\\Mail\\MailServiceProvider", - "swift.mailer": "Illuminate\\Mail\\MailServiceProvider", - "swift.transport": "Illuminate\\Mail\\MailServiceProvider", - "Illuminate\\Contracts\\Pipeline\\Hub": "Illuminate\\Pipeline\\PipelineServiceProvider", - "queue": "Illuminate\\Queue\\QueueServiceProvider", - "queue.worker": "Illuminate\\Queue\\QueueServiceProvider", - "queue.listener": "Illuminate\\Queue\\QueueServiceProvider", - "queue.failer": "Illuminate\\Queue\\QueueServiceProvider", - "command.queue.work": "Illuminate\\Queue\\QueueServiceProvider", - "command.queue.listen": "Illuminate\\Queue\\QueueServiceProvider", - "command.queue.restart": "Illuminate\\Queue\\QueueServiceProvider", - "command.queue.subscribe": "Illuminate\\Queue\\QueueServiceProvider", - "queue.connection": "Illuminate\\Queue\\QueueServiceProvider", - "redis": "Illuminate\\Redis\\RedisServiceProvider", - "auth.password": "Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider", - "auth.password.tokens": "Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider", - "translator": "Illuminate\\Translation\\TranslationServiceProvider", - "translation.loader": "Illuminate\\Translation\\TranslationServiceProvider", - "html": "Illuminate\\Html\\HtmlServiceProvider", - "form": "Illuminate\\Html\\HtmlServiceProvider" - }, - "when": { - "Illuminate\\Foundation\\Providers\\ArtisanServiceProvider": [], - "Illuminate\\Bus\\BusServiceProvider": [], - "Illuminate\\Cache\\CacheServiceProvider": [], - "Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider": [], - "Illuminate\\Hashing\\HashServiceProvider": [], - "Illuminate\\Mail\\MailServiceProvider": [], - "Illuminate\\Pipeline\\PipelineServiceProvider": [], - "Illuminate\\Queue\\QueueServiceProvider": [], - "Illuminate\\Redis\\RedisServiceProvider": [], - "Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider": [], - "Illuminate\\Translation\\TranslationServiceProvider": [], - "Illuminate\\Html\\HtmlServiceProvider": [] - } -} \ No newline at end of file diff --git a/application/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php b/application/vendor/swiftmailer/swiftmailer/lib/swiftmailer_generate_mimes_config.php old mode 100644 new mode 100755 diff --git a/application/vendor/symfony/console/Application.php b/application/vendor/symfony/console/Application.php index 5ad89c1..d168405 100644 --- a/application/vendor/symfony/console/Application.php +++ b/application/vendor/symfony/console/Application.php @@ -11,11 +11,8 @@ namespace Symfony\Component\Console; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; @@ -25,7 +22,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\ConsoleOutputInterface; @@ -34,13 +30,11 @@ use Symfony\Component\Console\Command\ListCommand; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Helper\ProgressHelper; -use Symfony\Component\Console\Helper\TableHelper; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleExceptionEvent; use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\Debug\Exception\FatalThrowableError; +use Symfony\Component\Console\Exception\CommandNotFoundException; +use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** @@ -72,9 +66,10 @@ class Application private $dispatcher; private $terminalDimensions; private $defaultCommand; - private $initialized; /** + * Constructor. + * * @param string $name The name of the application * @param string $version The version of the application */ @@ -83,6 +78,12 @@ public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') $this->name = $name; $this->version = $version; $this->defaultCommand = 'list'; + $this->helperSet = $this->getDefaultHelperSet(); + $this->definition = $this->getDefaultInputDefinition(); + + foreach ($this->getDefaultCommands() as $command) { + $this->add($command); + } } public function setDispatcher(EventDispatcherInterface $dispatcher) @@ -93,9 +94,12 @@ public function setDispatcher(EventDispatcherInterface $dispatcher) /** * Runs the current application. * + * @param InputInterface $input An Input instance + * @param OutputInterface $output An Output instance + * * @return int 0 if everything went fine, or an error code * - * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. + * @throws \Exception When doRun returns Exception */ public function run(InputInterface $input = null, OutputInterface $output = null) { @@ -110,12 +114,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null $this->configureIO($input, $output); try { - $e = null; $exitCode = $this->doRun($input, $output); } catch (\Exception $e) { - } - - if (null !== $e) { if (!$this->catchExceptions) { throw $e; } @@ -151,18 +151,21 @@ public function run(InputInterface $input = null, OutputInterface $output = null /** * Runs the current application. * + * @param InputInterface $input An Input instance + * @param OutputInterface $output An Output instance + * * @return int 0 if everything went fine, or an error code */ public function doRun(InputInterface $input, OutputInterface $output) { - if (true === $input->hasParameterOption(array('--version', '-V'))) { + if (true === $input->hasParameterOption(array('--version', '-V'), true)) { $output->writeln($this->getLongVersion()); return 0; } $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(array('--help', '-h'))) { + if (true === $input->hasParameterOption(array('--help', '-h'), true)) { if (!$name) { $name = 'help'; $input = new ArrayInput(array('command' => 'help')); @@ -173,16 +176,9 @@ public function doRun(InputInterface $input, OutputInterface $output) if (!$name) { $name = $this->defaultCommand; - $definition = $this->getDefinition(); - $definition->setArguments(array_merge( - $definition->getArguments(), - array( - 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ) - )); + $input = new ArrayInput(array('command' => $this->defaultCommand)); } - $this->runningCommand = null; // the command name MUST be the first element of the input $command = $this->find($name); @@ -193,6 +189,11 @@ public function doRun(InputInterface $input, OutputInterface $output) return $exitCode; } + /** + * Set a helper set to be used with the command. + * + * @param HelperSet $helperSet The helper set + */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -205,13 +206,14 @@ public function setHelperSet(HelperSet $helperSet) */ public function getHelperSet() { - if (!$this->helperSet) { - $this->helperSet = $this->getDefaultHelperSet(); - } - return $this->helperSet; } + /** + * Set an input definition to be used with this application. + * + * @param InputDefinition $definition The input definition + */ public function setDefinition(InputDefinition $definition) { $this->definition = $definition; @@ -224,10 +226,6 @@ public function setDefinition(InputDefinition $definition) */ public function getDefinition() { - if (!$this->definition) { - $this->definition = $this->getDefaultInputDefinition(); - } - return $this->definition; } @@ -335,7 +333,7 @@ public function register($name) * Adds an array of command objects. * * If a Command is not enabled it will not be added. - * + * * @param Command[] $commands An array of commands */ public function addCommands(array $commands) @@ -351,12 +349,12 @@ public function addCommands(array $commands) * If a command with the same name already exists, it will be overridden. * If the command is not enabled it will not be added. * + * @param Command $command A Command object + * * @return Command|null The registered command if enabled or null */ public function add(Command $command) { - $this->init(); - $command->setApplication($this); if (!$command->isEnabled()) { @@ -366,7 +364,7 @@ public function add(Command $command) } if (null === $command->getDefinition()) { - throw new \LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command))); + throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command))); } $this->commands[$command->getName()] = $command; @@ -385,14 +383,12 @@ public function add(Command $command) * * @return Command A Command object * - * @throws \InvalidArgumentException When given command name does not exist + * @throws CommandNotFoundException When command name given does not exist */ public function get($name) { - $this->init(); - if (!isset($this->commands[$name])) { - throw new \InvalidArgumentException(sprintf('The command "%s" does not exist.', $name)); + throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); } $command = $this->commands[$name]; @@ -418,8 +414,6 @@ public function get($name) */ public function has($name) { - $this->init(); - return isset($this->commands[$name]); } @@ -451,7 +445,7 @@ public function getNamespaces() * * @return string A registered namespace * - * @throws \InvalidArgumentException When namespace is incorrect or ambiguous + * @throws CommandNotFoundException When namespace is incorrect or ambiguous */ public function findNamespace($namespace) { @@ -472,12 +466,12 @@ public function findNamespace($namespace) $message .= implode("\n ", $alternatives); } - throw new \InvalidArgumentException($message); + throw new CommandNotFoundException($message, $alternatives); } $exact = in_array($namespace, $namespaces, true); if (count($namespaces) > 1 && !$exact) { - throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces)))); + throw new CommandNotFoundException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); } return $exact ? $namespace : reset($namespaces); @@ -493,12 +487,10 @@ public function findNamespace($namespace) * * @return Command A Command instance * - * @throws \InvalidArgumentException When command name is incorrect or ambiguous + * @throws CommandNotFoundException When command name is incorrect or ambiguous */ public function find($name) { - $this->init(); - $aliases = array(); $allCommands = array_keys($this->commands); $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); $commands = preg_grep('{^'.$expr.'}', $allCommands); @@ -520,25 +512,24 @@ public function find($name) $message .= implode("\n ", $alternatives); } - throw new \InvalidArgumentException($message); + throw new CommandNotFoundException($message, $alternatives); } // filter out aliases for commands which are already on the list if (count($commands) > 1) { $commandList = $this->commands; - $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands, &$aliases) { + $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) { $commandName = $commandList[$nameOrAlias]->getName(); - $aliases[$nameOrAlias] = $commandName; return $commandName === $nameOrAlias || !in_array($commandName, $commands); }); } - $exact = in_array($name, $commands, true) || isset($aliases[$name]); - if (!$exact && count($commands) > 1) { + $exact = in_array($name, $commands, true); + if (count($commands) > 1 && !$exact) { $suggestions = $this->getAbbreviationSuggestions(array_values($commands)); - throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions)); + throw new CommandNotFoundException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions), array_values($commands)); } return $this->get($exact ? $name : reset($commands)); @@ -555,8 +546,6 @@ public function find($name) */ public function all($namespace = null) { - $this->init(); - if (null === $namespace) { return $this->commands; } @@ -591,75 +580,32 @@ public static function getAbbreviations($names) return $abbrevs; } - /** - * Returns a text representation of the Application. - * - * @param string $namespace An optional namespace name - * @param bool $raw Whether to return raw command list - * - * @return string A string representing the Application - * - * @deprecated since version 2.3, to be removed in 3.0. - */ - public function asText($namespace = null, $raw = false) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); - - $descriptor = new TextDescriptor(); - $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, !$raw); - $descriptor->describe($output, $this, array('namespace' => $namespace, 'raw_output' => true)); - - return $output->fetch(); - } - - /** - * Returns an XML representation of the Application. - * - * @param string $namespace An optional namespace name - * @param bool $asDom Whether to return a DOM or an XML string - * - * @return string|\DOMDocument An XML string representing the Application - * - * @deprecated since version 2.3, to be removed in 3.0. - */ - public function asXml($namespace = null, $asDom = false) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); - - $descriptor = new XmlDescriptor(); - - if ($asDom) { - return $descriptor->getApplicationDocument($this, $namespace); - } - - $output = new BufferedOutput(); - $descriptor->describe($output, $this, array('namespace' => $namespace)); - - return $output->fetch(); - } - /** * Renders a caught exception. + * + * @param \Exception $e An exception instance + * @param OutputInterface $output An OutputInterface instance */ - public function renderException($e, $output) + public function renderException(\Exception $e, OutputInterface $output) { - $output->writeln(''); + $output->writeln('', OutputInterface::VERBOSITY_QUIET); do { $title = sprintf(' [%s] ', get_class($e)); - $len = Helper::strlen($title); + $len = $this->stringWidth($title); $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX; // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327 if (defined('HHVM_VERSION') && $width > 1 << 31) { $width = 1 << 31; } + $formatter = $output->getFormatter(); $lines = array(); - foreach (preg_split('/\r?\n/', trim($e->getMessage())) as $line) { + foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) { foreach ($this->splitStringByWidth($line, $width - 4) as $line) { // pre-format lines to get the right string length - $lineLength = Helper::strlen($line) + 4; + $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4; $lines[] = array($line, $lineLength); $len = max($lineLength, $len); @@ -667,25 +613,25 @@ public function renderException($e, $output) } $messages = array(); - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::strlen($title)))); + $messages[] = $emptyLine = $formatter->format(sprintf('%s', str_repeat(' ', $len))); + $messages[] = $formatter->format(sprintf('%s%s', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title))))); foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); + $messages[] = $formatter->format(sprintf(' %s %s', $line[0], str_repeat(' ', $len - $line[1]))); } $messages[] = $emptyLine; $messages[] = ''; - $output->writeln($messages); + $output->writeln($messages, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET); if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $output->writeln('Exception trace:'); + $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); // exception related properties $trace = $e->getTrace(); array_unshift($trace, array( 'function' => '', - 'file' => null !== $e->getFile() ? $e->getFile() : 'n/a', - 'line' => null !== $e->getLine() ? $e->getLine() : 'n/a', + 'file' => $e->getFile() !== null ? $e->getFile() : 'n/a', + 'line' => $e->getLine() !== null ? $e->getLine() : 'n/a', 'args' => array(), )); @@ -696,16 +642,16 @@ public function renderException($e, $output) $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a'; $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; - $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line)); + $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET); } - $output->writeln(''); + $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } while ($e = $e->getPrevious()); if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName()))); - $output->writeln(''); + $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET); + $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } @@ -777,7 +723,7 @@ public function getTerminalDimensions() * @param int $width The width * @param int $height The height * - * @return $this + * @return Application The current application */ public function setTerminalDimensions($width, $height) { @@ -788,16 +734,19 @@ public function setTerminalDimensions($width, $height) /** * Configures the input and output instances based on the user arguments and options. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance */ protected function configureIO(InputInterface $input, OutputInterface $output) { - if (true === $input->hasParameterOption(array('--ansi'))) { + if (true === $input->hasParameterOption(array('--ansi'), true)) { $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(array('--no-ansi'))) { + } elseif (true === $input->hasParameterOption(array('--no-ansi'), true)) { $output->setDecorated(false); } - if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) { + if (true === $input->hasParameterOption(array('--no-interaction', '-n'), true)) { $input->setInteractive(false); } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) { $inputStream = $this->getHelperSet()->get('question')->getInputStream(); @@ -806,15 +755,14 @@ protected function configureIO(InputInterface $input, OutputInterface $output) } } - if (true === $input->hasParameterOption(array('--quiet', '-q'))) { + if (true === $input->hasParameterOption(array('--quiet', '-q'), true)) { $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - $input->setInteractive(false); } else { - if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || 3 === $input->getParameterOption('--verbose')) { + if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || $input->getParameterOption('--verbose', false, true) === 3) { $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - } elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2') || 2 === $input->getParameterOption('--verbose')) { + } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || $input->getParameterOption('--verbose', false, true) === 2) { $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - } elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose') || $input->getParameterOption('--verbose')) { + } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); } } @@ -826,7 +774,13 @@ protected function configureIO(InputInterface $input, OutputInterface $output) * If an event dispatcher has been attached to the application, * events are also dispatched during the life-cycle of the command. * + * @param Command $command A Command instance + * @param InputInterface $input An Input instance + * @param OutputInterface $output An Output instance + * * @return int 0 if everything went fine, or an error code + * + * @throws \Exception when the command being run threw an exception */ protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) { @@ -840,44 +794,46 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI return $command->run($input, $output); } - $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; - + // bind before the console.command event, so the listeners have access to input options/arguments try { - $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); + $command->mergeApplicationDefinition(); + $input->bind($command->getDefinition()); + } catch (ExceptionInterface $e) { + // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition + } - if ($event->commandShouldRun()) { + $event = new ConsoleCommandEvent($command, $input, $output); + $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); + + if ($event->commandShouldRun()) { + try { $exitCode = $command->run($input, $output); - } else { - $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; - } - } catch (\Exception $e) { - } catch (\Throwable $e) { - } - if (null !== $e) { - $x = $e instanceof \Exception ? $e : new FatalThrowableError($e); - $event = new ConsoleExceptionEvent($command, $input, $output, $x, $x->getCode()); - $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event); + } catch (\Exception $e) { + $event = new ConsoleExceptionEvent($command, $input, $output, $e, $e->getCode()); + $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event); - if ($x !== $event->getException()) { $e = $event->getException(); + + $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode()); + $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); + + throw $e; } - $exitCode = $e->getCode(); + } else { + $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; } $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); - if (null !== $e) { - throw $e; - } - return $event->getExitCode(); } /** * Gets the name of the command based on input. * + * @param InputInterface $input The input interface + * * @return string The command name */ protected function getCommandName(InputInterface $input) @@ -924,9 +880,6 @@ protected function getDefaultHelperSet() { return new HelperSet(array( new FormatterHelper(), - new DialogHelper(false), - new ProgressHelper(false), - new TableHelper(false), new DebugFormatterHelper(), new ProcessHelper(), new QuestionHelper(), @@ -1015,8 +968,8 @@ public function extractNamespace($name, $limit = null) * Finds alternative of $name among $collection, * if nothing is found in $collection, try in $abbrevs. * - * @param string $name The string - * @param iterable $collection The collection + * @param string $name The string + * @param array|\Traversable $collection The collection * * @return string[] A sorted array of similar string */ @@ -1072,16 +1025,20 @@ public function setDefaultCommand($commandName) $this->defaultCommand = $commandName; } + private function stringWidth($string) + { + if (false === $encoding = mb_detect_encoding($string, null, true)) { + return strlen($string); + } + + return mb_strwidth($string, $encoding); + } + private function splitStringByWidth($string, $width) { // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. // additionally, array_slice() is not enough as some character has doubled width. // we need a function to split string not by character count but by string width - - if (!function_exists('mb_strwidth')) { - return str_split($string, $width); - } - if (false === $encoding = mb_detect_encoding($string, null, true)) { return str_split($string, $width); } @@ -1099,8 +1056,9 @@ private function splitStringByWidth($string, $width) $lines[] = str_pad($line, $width); $line = $char; } - - $lines[] = count($lines) ? str_pad($line, $width) : $line; + if ('' !== $line) { + $lines[] = count($lines) ? str_pad($line, $width) : $line; + } mb_convert_variables($encoding, 'utf8', $lines); @@ -1130,16 +1088,4 @@ private function extractAllNamespaces($name) return $namespaces; } - - private function init() - { - if ($this->initialized) { - return; - } - $this->initialized = true; - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } } diff --git a/application/vendor/symfony/console/CHANGELOG.md b/application/vendor/symfony/console/CHANGELOG.md index 07254c6..8021068 100644 --- a/application/vendor/symfony/console/CHANGELOG.md +++ b/application/vendor/symfony/console/CHANGELOG.md @@ -1,6 +1,17 @@ CHANGELOG ========= +2.8.3 +----- + + * remove readline support from the question helper as it caused issues + +2.8.0 +----- + + * use readline for user input in the question helper when available to allow + the use of arrow keys + 2.6.0 ----- diff --git a/application/vendor/symfony/console/Command/Command.php b/application/vendor/symfony/console/Command/Command.php index 3fe12e8..d212a32 100644 --- a/application/vendor/symfony/console/Command/Command.php +++ b/application/vendor/symfony/console/Command/Command.php @@ -11,16 +11,16 @@ namespace Symfony\Component\Console\Command; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; +use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\HelperSet; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; /** * Base class for all commands. @@ -45,9 +45,11 @@ class Command private $helperSet; /** + * Constructor. + * * @param string|null $name The name of the command; passing null means it must be set in configure() * - * @throws \LogicException When the command name is empty + * @throws LogicException When the command name is empty */ public function __construct($name = null) { @@ -60,7 +62,7 @@ public function __construct($name = null) $this->configure(); if (!$this->name) { - throw new \LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this))); + throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this))); } } @@ -74,6 +76,11 @@ public function ignoreValidationErrors() $this->ignoreValidationErrors = true; } + /** + * Sets the application instance for this command. + * + * @param Application $application An Application instance + */ public function setApplication(Application $application = null) { $this->application = $application; @@ -84,6 +91,11 @@ public function setApplication(Application $application = null) } } + /** + * Sets the helper set. + * + * @param HelperSet $helperSet A HelperSet instance + */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -137,15 +149,18 @@ protected function configure() * execute() method, you set the code to execute by passing * a Closure to the setCode() method. * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * * @return null|int null or 0 if everything went fine, or an error code * - * @throws \LogicException When this abstract method is not implemented + * @throws LogicException When this abstract method is not implemented * * @see setCode() */ protected function execute(InputInterface $input, OutputInterface $output) { - throw new \LogicException('You must override the execute() method in the concrete command class.'); + throw new LogicException('You must override the execute() method in the concrete command class.'); } /** @@ -154,6 +169,9 @@ protected function execute(InputInterface $input, OutputInterface $output) * This method is executed before the InputDefinition is validated. * This means that this is the only place where the command can * interactively ask for values of missing required arguments. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance */ protected function interact(InputInterface $input, OutputInterface $output) { @@ -164,6 +182,9 @@ protected function interact(InputInterface $input, OutputInterface $output) * * This is mainly useful when a lot of commands extends one main command * where some things need to be initialized based on the input arguments and options. + * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance */ protected function initialize(InputInterface $input, OutputInterface $output) { @@ -176,9 +197,12 @@ protected function initialize(InputInterface $input, OutputInterface $output) * setCode() method or by overriding the execute() method * in a sub-class. * + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * * @return int The command exit code * - * @throws \Exception When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. + * @throws \Exception * * @see setCode() * @see execute() @@ -195,7 +219,7 @@ public function run(InputInterface $input, OutputInterface $output) // bind the input against the command specific arguments/options try { $input->bind($this->definition); - } catch (\Exception $e) { + } catch (ExceptionInterface $e) { if (!$this->ignoreValidationErrors) { throw $e; } @@ -205,13 +229,7 @@ public function run(InputInterface $input, OutputInterface $output) if (null !== $this->processTitle) { if (function_exists('cli_set_process_title')) { - if (!@cli_set_process_title($this->processTitle)) { - if ('Darwin' === PHP_OS) { - $output->writeln('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.'); - } else { - cli_set_process_title($this->processTitle); - } - } + cli_set_process_title($this->processTitle); } elseif (function_exists('setproctitle')) { setproctitle($this->processTitle); } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { @@ -249,16 +267,19 @@ public function run(InputInterface $input, OutputInterface $output) * * @param callable $code A callable(InputInterface $input, OutputInterface $output) * - * @return $this + * @return Command The current instance * - * @throws \InvalidArgumentException + * @throws InvalidArgumentException * * @see execute() */ - public function setCode($code) + public function setCode(callable $code) { - if (!is_callable($code)) { - throw new \InvalidArgumentException('Invalid callable provided to Command::setCode.'); + if ($code instanceof \Closure) { + $r = new \ReflectionFunction($code); + if (null === $r->getClosureThis()) { + $code = \Closure::bind($code, $this); + } } $this->code = $code; @@ -298,7 +319,7 @@ public function mergeApplicationDefinition($mergeArgs = true) * * @param array|InputDefinition $definition An array of argument and option instances or a definition instance * - * @return $this + * @return Command The current instance */ public function setDefinition($definition) { @@ -324,7 +345,7 @@ public function getDefinition() } /** - * Gets the InputDefinition to be used to create XML and Text representations of this Command. + * Gets the InputDefinition to be used to create representations of this Command. * * Can be overridden to provide the original command representation when it would otherwise * be changed by merging with the application InputDefinition. @@ -346,7 +367,7 @@ public function getNativeDefinition() * @param string $description A description text * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) * - * @return $this + * @return Command The current instance */ public function addArgument($name, $mode = null, $description = '', $default = null) { @@ -364,7 +385,7 @@ public function addArgument($name, $mode = null, $description = '', $default = n * @param string $description A description text * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) * - * @return $this + * @return Command The current instance */ public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null) { @@ -383,9 +404,9 @@ public function addOption($name, $shortcut = null, $mode = null, $description = * * @param string $name The command name * - * @return $this + * @return Command The current instance * - * @throws \InvalidArgumentException When the name is invalid + * @throws InvalidArgumentException When the name is invalid */ public function setName($name) { @@ -406,7 +427,7 @@ public function setName($name) * * @param string $title The process title * - * @return $this + * @return Command The current instance */ public function setProcessTitle($title) { @@ -430,7 +451,7 @@ public function getName() * * @param string $description The description for the command * - * @return $this + * @return Command The current instance */ public function setDescription($description) { @@ -454,7 +475,7 @@ public function getDescription() * * @param string $help The help for the command * - * @return $this + * @return Command The current instance */ public function setHelp($help) { @@ -500,14 +521,14 @@ public function getProcessedHelp() * * @param string[] $aliases An array of aliases for the command * - * @return $this + * @return Command The current instance * - * @throws \InvalidArgumentException When an alias is invalid + * @throws InvalidArgumentException When an alias is invalid */ public function setAliases($aliases) { if (!is_array($aliases) && !$aliases instanceof \Traversable) { - throw new \InvalidArgumentException('$aliases must be an array or an instance of \Traversable'); + throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable'); } foreach ($aliases as $alias) { @@ -551,8 +572,6 @@ public function getSynopsis($short = false) * Add a command usage example. * * @param string $usage The usage, it'll be prefixed with the command name - * - * @return $this */ public function addUsage($usage) { @@ -582,61 +601,18 @@ public function getUsages() * * @return mixed The helper value * - * @throws \LogicException if no HelperSet is defined - * @throws \InvalidArgumentException if the helper is not defined + * @throws LogicException if no HelperSet is defined + * @throws InvalidArgumentException if the helper is not defined */ public function getHelper($name) { if (null === $this->helperSet) { - throw new \LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); + throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); } return $this->helperSet->get($name); } - /** - * Returns a text representation of the command. - * - * @return string A string representing the command - * - * @deprecated since version 2.3, to be removed in 3.0. - */ - public function asText() - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); - - $descriptor = new TextDescriptor(); - $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); - $descriptor->describe($output, $this, array('raw_output' => true)); - - return $output->fetch(); - } - - /** - * Returns an XML representation of the command. - * - * @param bool $asDom Whether to return a DOM or an XML string - * - * @return string|\DOMDocument An XML string representing the command - * - * @deprecated since version 2.3, to be removed in 3.0. - */ - public function asXml($asDom = false) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); - - $descriptor = new XmlDescriptor(); - - if ($asDom) { - return $descriptor->getCommandDocument($this); - } - - $output = new BufferedOutput(); - $descriptor->describe($output, $this); - - return $output->fetch(); - } - /** * Validates a command name. * @@ -644,12 +620,12 @@ public function asXml($asDom = false) * * @param string $name * - * @throws \InvalidArgumentException When the name is invalid + * @throws InvalidArgumentException When the name is invalid */ private function validateName($name) { if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); + throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); } } } diff --git a/application/vendor/symfony/console/Command/HelpCommand.php b/application/vendor/symfony/console/Command/HelpCommand.php index 27e23e1..b8fd911 100644 --- a/application/vendor/symfony/console/Command/HelpCommand.php +++ b/application/vendor/symfony/console/Command/HelpCommand.php @@ -37,7 +37,6 @@ protected function configure() ->setName('help') ->setDefinition(array( new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), )) @@ -57,6 +56,11 @@ protected function configure() ; } + /** + * Sets the command. + * + * @param Command $command The command to set + */ public function setCommand(Command $command) { $this->command = $command; @@ -71,12 +75,6 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->command = $this->getApplication()->find($input->getArgument('command_name')); } - if ($input->getOption('xml')) { - @trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED); - - $input->setOption('format', 'xml'); - } - $helper = new DescriptorHelper(); $helper->describe($output, $this->command, array( 'format' => $input->getOption('format'), diff --git a/application/vendor/symfony/console/Command/ListCommand.php b/application/vendor/symfony/console/Command/ListCommand.php index 5e1b926..179ddea 100644 --- a/application/vendor/symfony/console/Command/ListCommand.php +++ b/application/vendor/symfony/console/Command/ListCommand.php @@ -68,12 +68,6 @@ public function getNativeDefinition() */ protected function execute(InputInterface $input, OutputInterface $output) { - if ($input->getOption('xml')) { - @trigger_error('The --xml option was deprecated in version 2.7 and will be removed in version 3.0. Use the --format option instead.', E_USER_DEPRECATED); - - $input->setOption('format', 'xml'); - } - $helper = new DescriptorHelper(); $helper->describe($output, $this->getApplication(), array( 'format' => $input->getOption('format'), @@ -89,7 +83,6 @@ private function createDefinition() { return new InputDefinition(array( new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('xml', null, InputOption::VALUE_NONE, 'To output list as XML'), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), )); diff --git a/application/vendor/symfony/console/ConsoleEvents.php b/application/vendor/symfony/console/ConsoleEvents.php index 6dae6ce..1ed41b7 100644 --- a/application/vendor/symfony/console/ConsoleEvents.php +++ b/application/vendor/symfony/console/ConsoleEvents.php @@ -27,6 +27,8 @@ final class ConsoleEvents * instance. * * @Event + * + * @var string */ const COMMAND = 'console.command'; @@ -38,6 +40,8 @@ final class ConsoleEvents * instance. * * @Event + * + * @var string */ const TERMINATE = 'console.terminate'; @@ -50,6 +54,8 @@ final class ConsoleEvents * instance. * * @Event + * + * @var string */ const EXCEPTION = 'console.exception'; } diff --git a/application/vendor/symfony/console/Descriptor/ApplicationDescription.php b/application/vendor/symfony/console/Descriptor/ApplicationDescription.php index 2100b94..89961b9 100644 --- a/application/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/application/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -13,6 +13,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\CommandNotFoundException; /** * @author Jean-François Simon @@ -23,7 +24,14 @@ class ApplicationDescription { const GLOBAL_NAMESPACE = '_global'; + /** + * @var Application + */ private $application; + + /** + * @var null|string + */ private $namespace; /** @@ -41,6 +49,12 @@ class ApplicationDescription */ private $aliases; + /** + * Constructor. + * + * @param Application $application + * @param string|null $namespace + */ public function __construct(Application $application, $namespace = null) { $this->application = $application; @@ -76,12 +90,12 @@ public function getCommands() * * @return Command * - * @throws \InvalidArgumentException + * @throws CommandNotFoundException */ public function getCommand($name) { if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new \InvalidArgumentException(sprintf('Command %s does not exist.', $name)); + throw new CommandNotFoundException(sprintf('Command %s does not exist.', $name)); } return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name]; @@ -116,6 +130,8 @@ private function inspectApplication() } /** + * @param array $commands + * * @return array */ private function sortCommands(array $commands) diff --git a/application/vendor/symfony/console/Descriptor/Descriptor.php b/application/vendor/symfony/console/Descriptor/Descriptor.php index 469bbd7..50dd86c 100644 --- a/application/vendor/symfony/console/Descriptor/Descriptor.php +++ b/application/vendor/symfony/console/Descriptor/Descriptor.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Exception\InvalidArgumentException; /** * @author Jean-François Simon @@ -28,7 +29,7 @@ abstract class Descriptor implements DescriptorInterface /** * @var OutputInterface */ - private $output; + protected $output; /** * {@inheritdoc} @@ -54,7 +55,7 @@ public function describe(OutputInterface $output, $object, array $options = arra $this->describeApplication($object, $options); break; default: - throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object))); + throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object))); } } @@ -72,6 +73,9 @@ protected function write($content, $decorated = false) /** * Describes an InputArgument instance. * + * @param InputArgument $argument + * @param array $options + * * @return string|mixed */ abstract protected function describeInputArgument(InputArgument $argument, array $options = array()); @@ -79,6 +83,9 @@ abstract protected function describeInputArgument(InputArgument $argument, array /** * Describes an InputOption instance. * + * @param InputOption $option + * @param array $options + * * @return string|mixed */ abstract protected function describeInputOption(InputOption $option, array $options = array()); @@ -86,6 +93,9 @@ abstract protected function describeInputOption(InputOption $option, array $opti /** * Describes an InputDefinition instance. * + * @param InputDefinition $definition + * @param array $options + * * @return string|mixed */ abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array()); @@ -93,6 +103,9 @@ abstract protected function describeInputDefinition(InputDefinition $definition, /** * Describes a Command instance. * + * @param Command $command + * @param array $options + * * @return string|mixed */ abstract protected function describeCommand(Command $command, array $options = array()); @@ -100,6 +113,9 @@ abstract protected function describeCommand(Command $command, array $options = a /** * Describes an Application instance. * + * @param Application $application + * @param array $options + * * @return string|mixed */ abstract protected function describeApplication(Application $application, array $options = array()); diff --git a/application/vendor/symfony/console/Descriptor/DescriptorInterface.php b/application/vendor/symfony/console/Descriptor/DescriptorInterface.php index 5d3339a..3929b6d 100644 --- a/application/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ b/application/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -21,7 +21,7 @@ interface DescriptorInterface { /** - * Describes an object if supported. + * Describes an InputArgument instance. * * @param OutputInterface $output * @param object $object diff --git a/application/vendor/symfony/console/Descriptor/JsonDescriptor.php b/application/vendor/symfony/console/Descriptor/JsonDescriptor.php index 0a22274..87e38fd 100644 --- a/application/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ b/application/vendor/symfony/console/Descriptor/JsonDescriptor.php @@ -81,6 +81,9 @@ protected function describeApplication(Application $application, array $options /** * Writes data as json. * + * @param array $data + * @param array $options + * * @return array|string */ private function writeData(array $data, array $options) @@ -89,6 +92,8 @@ private function writeData(array $data, array $options) } /** + * @param InputArgument $argument + * * @return array */ private function getInputArgumentData(InputArgument $argument) @@ -98,27 +103,31 @@ private function getInputArgumentData(InputArgument $argument) 'is_required' => $argument->isRequired(), 'is_array' => $argument->isArray(), 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), + 'default' => $argument->getDefault(), ); } /** + * @param InputOption $option + * * @return array */ private function getInputOptionData(InputOption $option) { return array( 'name' => '--'.$option->getName(), - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', + 'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '', 'accept_value' => $option->acceptValue(), 'is_value_required' => $option->isValueRequired(), 'is_multiple' => $option->isArray(), 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => INF === $option->getDefault() ? 'INF' : $option->getDefault(), + 'default' => $option->getDefault(), ); } /** + * @param InputDefinition $definition + * * @return array */ private function getInputDefinitionData(InputDefinition $definition) @@ -137,6 +146,8 @@ private function getInputDefinitionData(InputDefinition $definition) } /** + * @param Command $command + * * @return array */ private function getCommandData(Command $command) diff --git a/application/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/application/vendor/symfony/console/Descriptor/MarkdownDescriptor.php index 76399ca..d3d76a4 100644 --- a/application/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ b/application/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -13,7 +13,6 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; @@ -50,7 +49,7 @@ protected function describeInputOption(InputOption $option, array $options = arr $this->write( '**'.$option->getName().':**'."\n\n" .'* Name: `--'.$option->getName().'`'."\n" - .'* Shortcut: '.($option->getShortcut() ? '`-'.str_replace('|', '|-', $option->getShortcut()).'`' : '')."\n" + .'* Shortcut: '.($option->getShortcut() ? '`-'.implode('|-', explode('|', $option->getShortcut())).'`' : '')."\n" .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" @@ -95,11 +94,11 @@ protected function describeCommand(Command $command, array $options = array()) $this->write( $command->getName()."\n" - .str_repeat('-', Helper::strlen($command->getName()))."\n\n" + .str_repeat('-', strlen($command->getName()))."\n\n" .'* Description: '.($command->getDescription() ?: '')."\n" .'* Usage:'."\n\n" .array_reduce(array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.' * `'.$usage.'`'."\n"; + return $carry .= ' * `'.$usage.'`'."\n"; }) ); @@ -122,7 +121,7 @@ protected function describeApplication(Application $application, array $options $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null; $description = new ApplicationDescription($application, $describedNamespace); - $this->write($application->getName()."\n".str_repeat('=', Helper::strlen($application->getName()))); + $this->write($application->getName()."\n".str_repeat('=', strlen($application->getName()))); foreach ($description->getNamespaces() as $namespace) { if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { diff --git a/application/vendor/symfony/console/Descriptor/TextDescriptor.php b/application/vendor/symfony/console/Descriptor/TextDescriptor.php index 1d64324..560ce15 100644 --- a/application/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/application/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -13,8 +13,6 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; @@ -39,14 +37,14 @@ protected function describeInputArgument(InputArgument $argument, array $options $default = ''; } - $totalWidth = isset($options['total_width']) ? $options['total_width'] : Helper::strlen($argument->getName()); - $spacingWidth = $totalWidth - strlen($argument->getName()); + $totalWidth = isset($options['total_width']) ? $options['total_width'] : strlen($argument->getName()); + $spacingWidth = $totalWidth - strlen($argument->getName()) + 2; - $this->writeText(sprintf(' %s %s%s%s', + $this->writeText(sprintf(' %s%s%s%s', $argument->getName(), str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), + // + 17 = 2 spaces + + + 2 spaces + preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $argument->getDescription()), $default ), $options); } @@ -77,13 +75,13 @@ protected function describeInputOption(InputOption $option, array $options = arr sprintf('--%s%s', $option->getName(), $value) ); - $spacingWidth = $totalWidth - Helper::strlen($synopsis); + $spacingWidth = $totalWidth - strlen($synopsis) + 2; - $this->writeText(sprintf(' %s %s%s%s%s', + $this->writeText(sprintf(' %s%s%s%s%s', $synopsis, str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), + // + 17 = 2 spaces + + + 2 spaces + preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $option->getDescription()), $default, $option->isArray() ? ' (multiple values allowed)' : '' ), $options); @@ -96,7 +94,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o { $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::strlen($argument->getName())); + $totalWidth = max($totalWidth, strlen($argument->getName())); } if ($definition->getArguments()) { @@ -143,7 +141,7 @@ protected function describeCommand(Command $command, array $options = array()) $this->writeText('Usage:', $options); foreach (array_merge(array($command->getSynopsis(true)), $command->getAliases(), $command->getUsages()) as $usage) { $this->writeText("\n"); - $this->writeText(' '.OutputFormatter::escape($usage), $options); + $this->writeText(' '.$usage, $options); } $this->writeText("\n"); @@ -158,7 +156,7 @@ protected function describeCommand(Command $command, array $options = array()) $this->writeText("\n"); $this->writeText('Help:', $options); $this->writeText("\n"); - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); + $this->writeText(' '.str_replace("\n", "\n ", $help), $options); $this->writeText("\n"); } } @@ -208,7 +206,7 @@ protected function describeApplication(Application $application, array $options foreach ($namespace['commands'] as $name) { $this->writeText("\n"); - $spacingWidth = $width - Helper::strlen($name); + $spacingWidth = $width - strlen($name); $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $description->getCommand($name)->getDescription()), $options); } } @@ -237,24 +235,6 @@ private function writeText($content, array $options = array()) */ private function formatDefaultValue($default) { - if (INF === $default) { - return 'INF'; - } - - if (is_string($default)) { - $default = OutputFormatter::escape($default); - } elseif (is_array($default)) { - foreach ($default as $key => $value) { - if (is_string($value)) { - $default[$key] = OutputFormatter::escape($value); - } - } - } - - if (\PHP_VERSION_ID < 50400) { - return str_replace(array('\/', '\\\\'), array('/', '\\'), json_encode($default)); - } - return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); } @@ -268,9 +248,9 @@ private function getColumnWidth(array $commands) $widths = array(); foreach ($commands as $command) { - $widths[] = Helper::strlen($command->getName()); + $widths[] = strlen($command->getName()); foreach ($command->getAliases() as $alias) { - $widths[] = Helper::strlen($alias); + $widths[] = strlen($alias); } } @@ -282,15 +262,15 @@ private function getColumnWidth(array $commands) * * @return int */ - private function calculateTotalWidthForOptions(array $options) + private function calculateTotalWidthForOptions($options) { $totalWidth = 0; foreach ($options as $option) { // "-" + shortcut + ", --" + name - $nameLength = 1 + max(strlen($option->getShortcut()), 1) + 4 + Helper::strlen($option->getName()); + $nameLength = 1 + max(strlen($option->getShortcut()), 1) + 4 + strlen($option->getName()); if ($option->acceptValue()) { - $valueLength = 1 + Helper::strlen($option->getName()); // = + value + $valueLength = 1 + strlen($option->getName()); // = + value $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] $nameLength += $valueLength; diff --git a/application/vendor/symfony/console/Descriptor/XmlDescriptor.php b/application/vendor/symfony/console/Descriptor/XmlDescriptor.php index c42fa42..b5676be 100644 --- a/application/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ b/application/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -27,6 +27,8 @@ class XmlDescriptor extends Descriptor { /** + * @param InputDefinition $definition + * * @return \DOMDocument */ public function getInputDefinitionDocument(InputDefinition $definition) @@ -48,6 +50,8 @@ public function getInputDefinitionDocument(InputDefinition $definition) } /** + * @param Command $command + * * @return \DOMDocument */ public function getCommandDocument(Command $command) @@ -90,9 +94,9 @@ public function getApplicationDocument(Application $application, $namespace = nu $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($rootXml = $dom->createElement('symfony')); - if ('UNKNOWN' !== $application->getName()) { + if ($application->getName() !== 'UNKNOWN') { $rootXml->setAttribute('name', $application->getName()); - if ('UNKNOWN' !== $application->getVersion()) { + if ($application->getVersion() !== 'UNKNOWN') { $rootXml->setAttribute('version', $application->getVersion()); } } @@ -168,6 +172,9 @@ protected function describeApplication(Application $application, array $options /** * Appends document children to parent node. + * + * @param \DOMNode $parentNode + * @param \DOMNode $importedParent */ private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) { @@ -179,6 +186,8 @@ private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) /** * Writes DOM document. * + * @param \DOMDocument $dom + * * @return \DOMDocument|string */ private function writeDocument(\DOMDocument $dom) @@ -188,6 +197,8 @@ private function writeDocument(\DOMDocument $dom) } /** + * @param InputArgument $argument + * * @return \DOMDocument */ private function getInputArgumentDocument(InputArgument $argument) @@ -212,6 +223,8 @@ private function getInputArgumentDocument(InputArgument $argument) } /** + * @param InputOption $option + * * @return \DOMDocument */ private function getInputOptionDocument(InputOption $option) @@ -223,7 +236,7 @@ private function getInputOptionDocument(InputOption $option) $pos = strpos($option->getShortcut(), '|'); if (false !== $pos) { $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); + $objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut()))); } else { $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); } diff --git a/application/vendor/symfony/console/Event/ConsoleCommandEvent.php b/application/vendor/symfony/console/Event/ConsoleCommandEvent.php index 2f517c1..92adf1e 100644 --- a/application/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/application/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -25,6 +25,8 @@ class ConsoleCommandEvent extends ConsoleEvent /** * Indicates if the command should be run or skipped. + * + * @var bool */ private $commandShouldRun = true; diff --git a/application/vendor/symfony/console/Exception/CommandNotFoundException.php b/application/vendor/symfony/console/Exception/CommandNotFoundException.php new file mode 100644 index 0000000..54f1a5b --- /dev/null +++ b/application/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * Represents an incorrect command name typed in the console. + * + * @author Jérôme Tamarelle + */ +class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface +{ + private $alternatives; + + /** + * @param string $message Exception message to throw + * @param array $alternatives List of similar defined names + * @param int $code Exception code + * @param Exception $previous previous exception used for the exception chaining + */ + public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null) + { + parent::__construct($message, $code, $previous); + + $this->alternatives = $alternatives; + } + + /** + * @return array A list of similar defined names + */ + public function getAlternatives() + { + return $this->alternatives; + } +} diff --git a/application/vendor/symfony/finder/Exception/OperationNotPermitedException.php b/application/vendor/symfony/console/Exception/ExceptionInterface.php similarity index 60% rename from application/vendor/symfony/finder/Exception/OperationNotPermitedException.php rename to application/vendor/symfony/console/Exception/ExceptionInterface.php index 3663112..491cc4c 100644 --- a/application/vendor/symfony/finder/Exception/OperationNotPermitedException.php +++ b/application/vendor/symfony/console/Exception/ExceptionInterface.php @@ -9,11 +9,13 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Finder\Exception; +namespace Symfony\Component\Console\Exception; /** - * @author Jean-François Simon + * ExceptionInterface. + * + * @author Jérôme Tamarelle */ -class OperationNotPermitedException extends AdapterFailureException +interface ExceptionInterface { } diff --git a/application/vendor/symfony/http-kernel/Tests/Fixtures/Controller/NullableController.php b/application/vendor/symfony/console/Exception/InvalidArgumentException.php similarity index 54% rename from application/vendor/symfony/http-kernel/Tests/Fixtures/Controller/NullableController.php rename to application/vendor/symfony/console/Exception/InvalidArgumentException.php index 9db4df7..07cc0b6 100644 --- a/application/vendor/symfony/http-kernel/Tests/Fixtures/Controller/NullableController.php +++ b/application/vendor/symfony/console/Exception/InvalidArgumentException.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\HttpKernel\Tests\Fixtures\Controller; +namespace Symfony\Component\Console\Exception; -class NullableController +/** + * @author Jérôme Tamarelle + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface { - public function action(?string $foo, ?\stdClass $bar, ?string $baz = 'value', $mandatory) - { - } } diff --git a/application/vendor/symfony/console/Exception/InvalidOptionException.php b/application/vendor/symfony/console/Exception/InvalidOptionException.php new file mode 100644 index 0000000..b2eec61 --- /dev/null +++ b/application/vendor/symfony/console/Exception/InvalidOptionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Exception; + +/** + * Represents an incorrect option name typed in the console. + * + * @author Jérôme Tamarelle + */ +class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/application/vendor/symfony/polyfill-util/Binary.php b/application/vendor/symfony/console/Exception/LogicException.php similarity index 55% rename from application/vendor/symfony/polyfill-util/Binary.php rename to application/vendor/symfony/console/Exception/LogicException.php index 23ff974..fc37b8d 100644 --- a/application/vendor/symfony/polyfill-util/Binary.php +++ b/application/vendor/symfony/console/Exception/LogicException.php @@ -9,14 +9,11 @@ * file that was distributed with this source code. */ -namespace Symfony\Polyfill\Util; +namespace Symfony\Component\Console\Exception; -if (\extension_loaded('mbstring')) { - class Binary extends BinaryOnFuncOverload - { - } -} else { - class Binary extends BinaryNoFuncOverload - { - } +/** + * @author Jérôme Tamarelle + */ +class LogicException extends \LogicException implements ExceptionInterface +{ } diff --git a/application/vendor/symfony/console/Exception/RuntimeException.php b/application/vendor/symfony/console/Exception/RuntimeException.php index 1324558..51d7d80 100644 --- a/application/vendor/symfony/console/Exception/RuntimeException.php +++ b/application/vendor/symfony/console/Exception/RuntimeException.php @@ -14,6 +14,6 @@ /** * @author Jérôme Tamarelle */ -class RuntimeException extends \RuntimeException +class RuntimeException extends \RuntimeException implements ExceptionInterface { } diff --git a/application/vendor/symfony/console/Formatter/OutputFormatter.php b/application/vendor/symfony/console/Formatter/OutputFormatter.php index c8a6a78..56cd5e5 100644 --- a/application/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/application/vendor/symfony/console/Formatter/OutputFormatter.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Formatter; +use Symfony\Component\Console\Exception\InvalidArgumentException; + /** * Formatter class for console output. * @@ -33,25 +35,10 @@ public static function escape($text) { $text = preg_replace('/([^\\\\]?)hasStyle($name)) { - throw new \InvalidArgumentException(sprintf('Undefined style: %s', $name)); + throw new InvalidArgumentException(sprintf('Undefined style: %s', $name)); } return $this->styles[strtolower($name)]; } /** - * {@inheritdoc} + * Formats a message according to the given styles. + * + * @param string $message The message to style + * + * @return string The styled message */ public function format($message) { @@ -166,8 +174,8 @@ public function format($message) $output .= $this->applyCurrentStyle(substr($message, $offset)); - if (false !== strpos($output, "\0")) { - return strtr($output, array("\0" => '\\', '\\<' => '<')); + if (false !== strpos($output, '<<')) { + return strtr($output, array('\\<' => '<', '<<' => '\\')); } return str_replace('\\<', '<', $output); @@ -186,7 +194,7 @@ public function getStyleStack() * * @param string $string * - * @return OutputFormatterStyle|false false if string is not format string + * @return OutputFormatterStyle|bool false if string is not format string */ private function createStyleFromString($string) { diff --git a/application/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/application/vendor/symfony/console/Formatter/OutputFormatterInterface.php index 281e240..5a52ba0 100644 --- a/application/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/application/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -55,8 +55,6 @@ public function hasStyle($name); * @param string $name * * @return OutputFormatterStyleInterface - * - * @throws \InvalidArgumentException When style isn't defined */ public function getStyle($name); diff --git a/application/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/application/vendor/symfony/console/Formatter/OutputFormatterStyle.php index e15b132..c7c6b4a 100644 --- a/application/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/application/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Formatter; +use Symfony\Component\Console\Exception\InvalidArgumentException; + /** * Formatter style class for defining styles. * @@ -77,7 +79,7 @@ public function __construct($foreground = null, $background = null, array $optio * * @param string|null $color The color name * - * @throws \InvalidArgumentException When the color name isn't defined + * @throws InvalidArgumentException When the color name isn't defined */ public function setForeground($color = null) { @@ -88,7 +90,7 @@ public function setForeground($color = null) } if (!isset(static::$availableForegroundColors[$color])) { - throw new \InvalidArgumentException(sprintf( + throw new InvalidArgumentException(sprintf( 'Invalid foreground color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableForegroundColors)) @@ -103,7 +105,7 @@ public function setForeground($color = null) * * @param string|null $color The color name * - * @throws \InvalidArgumentException When the color name isn't defined + * @throws InvalidArgumentException When the color name isn't defined */ public function setBackground($color = null) { @@ -114,7 +116,7 @@ public function setBackground($color = null) } if (!isset(static::$availableBackgroundColors[$color])) { - throw new \InvalidArgumentException(sprintf( + throw new InvalidArgumentException(sprintf( 'Invalid background color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableBackgroundColors)) @@ -129,12 +131,12 @@ public function setBackground($color = null) * * @param string $option The option name * - * @throws \InvalidArgumentException When the option name isn't defined + * @throws InvalidArgumentException When the option name isn't defined */ public function setOption($option) { if (!isset(static::$availableOptions[$option])) { - throw new \InvalidArgumentException(sprintf( + throw new InvalidArgumentException(sprintf( 'Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions)) @@ -151,12 +153,12 @@ public function setOption($option) * * @param string $option The option name * - * @throws \InvalidArgumentException When the option name isn't defined + * @throws InvalidArgumentException When the option name isn't defined */ public function unsetOption($option) { if (!isset(static::$availableOptions[$option])) { - throw new \InvalidArgumentException(sprintf( + throw new InvalidArgumentException(sprintf( 'Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions)) @@ -170,7 +172,9 @@ public function unsetOption($option) } /** - * {@inheritdoc} + * Sets multiple style options at once. + * + * @param array $options */ public function setOptions(array $options) { diff --git a/application/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/application/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index 4c7dc41..c36fda8 100644 --- a/application/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/application/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -48,6 +48,8 @@ public function unsetOption($option); /** * Sets multiple style options at once. + * + * @param array $options */ public function setOptions(array $options); diff --git a/application/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/application/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index b560087..e5d14ea 100644 --- a/application/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/application/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Formatter; +use Symfony\Component\Console\Exception\InvalidArgumentException; + /** * @author Jean-François Simon */ @@ -21,8 +23,16 @@ class OutputFormatterStyleStack */ private $styles; + /** + * @var OutputFormatterStyleInterface + */ private $emptyStyle; + /** + * Constructor. + * + * @param OutputFormatterStyleInterface|null $emptyStyle + */ public function __construct(OutputFormatterStyleInterface $emptyStyle = null) { $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle(); @@ -39,6 +49,8 @@ public function reset() /** * Pushes a style in the stack. + * + * @param OutputFormatterStyleInterface $style */ public function push(OutputFormatterStyleInterface $style) { @@ -48,9 +60,11 @@ public function push(OutputFormatterStyleInterface $style) /** * Pops a style from the stack. * + * @param OutputFormatterStyleInterface|null $style + * * @return OutputFormatterStyleInterface * - * @throws \InvalidArgumentException When style tags incorrectly nested + * @throws InvalidArgumentException When style tags incorrectly nested */ public function pop(OutputFormatterStyleInterface $style = null) { @@ -70,7 +84,7 @@ public function pop(OutputFormatterStyleInterface $style = null) } } - throw new \InvalidArgumentException('Incorrectly nested style tag found.'); + throw new InvalidArgumentException('Incorrectly nested style tag found.'); } /** @@ -88,7 +102,9 @@ public function getCurrent() } /** - * @return $this + * @param OutputFormatterStyleInterface $emptyStyle + * + * @return OutputFormatterStyleStack */ public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) { diff --git a/application/vendor/symfony/console/Helper/DescriptorHelper.php b/application/vendor/symfony/console/Helper/DescriptorHelper.php index 17fffe5..a53b476 100644 --- a/application/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/application/vendor/symfony/console/Helper/DescriptorHelper.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Descriptor\TextDescriptor; use Symfony\Component\Console\Descriptor\XmlDescriptor; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Exception\InvalidArgumentException; /** * This class adds helper method to describe objects in various formats. @@ -30,6 +31,9 @@ class DescriptorHelper extends Helper */ private $descriptors = array(); + /** + * Constructor. + */ public function __construct() { $this @@ -51,7 +55,7 @@ public function __construct() * @param object $object * @param array $options * - * @throws \InvalidArgumentException when the given format is not supported + * @throws InvalidArgumentException when the given format is not supported */ public function describe(OutputInterface $output, $object, array $options = array()) { @@ -61,7 +65,7 @@ public function describe(OutputInterface $output, $object, array $options = arra ), $options); if (!isset($this->descriptors[$options['format']])) { - throw new \InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); + throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); } $descriptor = $this->descriptors[$options['format']]; @@ -74,7 +78,7 @@ public function describe(OutputInterface $output, $object, array $options = arra * @param string $format * @param DescriptorInterface $descriptor * - * @return $this + * @return DescriptorHelper */ public function register($format, DescriptorInterface $descriptor) { diff --git a/application/vendor/symfony/console/Helper/DialogHelper.php b/application/vendor/symfony/console/Helper/DialogHelper.php deleted file mode 100644 index 0a5939a..0000000 --- a/application/vendor/symfony/console/Helper/DialogHelper.php +++ /dev/null @@ -1,500 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; - -/** - * The Dialog class provides helpers to interact with the user. - * - * @author Fabien Potencier - * - * @deprecated since version 2.5, to be removed in 3.0. - * Use {@link \Symfony\Component\Console\Helper\QuestionHelper} instead. - */ -class DialogHelper extends InputAwareHelper -{ - private $inputStream; - private static $shell; - private static $stty; - - public function __construct($triggerDeprecationError = true) - { - if ($triggerDeprecationError) { - @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED); - } - } - - /** - * Asks the user to select a value. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param array $choices List of choices to pick from - * @param bool|string $default The default answer if the user enters nothing - * @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite) - * @param string $errorMessage Message which will be shown if invalid value from choice list would be picked - * @param bool $multiselect Select more than one value separated by comma - * - * @return int|string|array The selected value or values (the key of the choices array) - * - * @throws \InvalidArgumentException - */ - public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $width = max(array_map('strlen', array_keys($choices))); - - $messages = (array) $question; - foreach ($choices as $key => $value) { - $messages[] = sprintf(" [%-{$width}s] %s", $key, $value); - } - - $output->writeln($messages); - - $result = $this->askAndValidate($output, '> ', function ($picked) use ($choices, $errorMessage, $multiselect) { - // Collapse all spaces. - $selectedChoices = str_replace(' ', '', $picked); - - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { - throw new \InvalidArgumentException(sprintf($errorMessage, $picked)); - } - $selectedChoices = explode(',', $selectedChoices); - } else { - $selectedChoices = array($picked); - } - - $multiselectChoices = array(); - - foreach ($selectedChoices as $value) { - if (empty($choices[$value])) { - throw new \InvalidArgumentException(sprintf($errorMessage, $value)); - } - $multiselectChoices[] = $value; - } - - if ($multiselect) { - return $multiselectChoices; - } - - return $picked; - }, $attempts, $default); - - return $result; - } - - /** - * Asks a question to the user. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param string $default The default answer if none is given by the user - * @param array $autocomplete List of values to autocomplete - * - * @return string The user answer - * - * @throws \RuntimeException If there is no data to read in the input stream - */ - public function ask(OutputInterface $output, $question, $default = null, array $autocomplete = null) - { - if ($this->input && !$this->input->isInteractive()) { - return $default; - } - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $output->write($question); - - $inputStream = $this->inputStream ?: STDIN; - - if (null === $autocomplete || !$this->hasSttyAvailable()) { - $ret = fgets($inputStream, 4096); - if (false === $ret) { - throw new \RuntimeException('Aborted'); - } - $ret = trim($ret); - } else { - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete; - $numMatches = count($matches); - - $sttyMode = shell_exec('stty -g'); - - // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) - shell_exec('stty -icanon -echo'); - - // Add highlighted text style - $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); - - // Read a keypress - while (!feof($inputStream)) { - $c = fread($inputStream, 1); - - // Backspace Character - if ("\177" === $c) { - if (0 === $numMatches && 0 !== $i) { - --$i; - // Move cursor backwards - $output->write("\033[1D"); - } - - if (0 === $i) { - $ofs = -1; - $matches = $autocomplete; - $numMatches = count($matches); - } else { - $numMatches = 0; - } - - // Pop the last character off the end of our string - $ret = substr($ret, 0, $i); - } elseif ("\033" === $c) { - // Did we read an escape sequence? - $c .= fread($inputStream, 2); - - // A = Up Arrow. B = Down Arrow - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = $matches[$ofs]; - // Echo out remaining chars for current match - $output->write(substr($ret, $i)); - $i = strlen($ret); - } - - if ("\n" === $c) { - $output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - $output->write($c); - $ret .= $c; - ++$i; - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete as $value) { - // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (0 === strpos($value, $ret) && $i !== strlen($value)) { - $matches[$numMatches++] = $value; - } - } - } - - // Erase characters from cursor to end of line - $output->write("\033[K"); - - if ($numMatches > 0 && -1 !== $ofs) { - // Save cursor position - $output->write("\0337"); - // Write highlighted text - $output->write(''.substr($matches[$ofs], $i).''); - // Restore cursor position - $output->write("\0338"); - } - } - - // Reset stty so it behaves normally again - shell_exec(sprintf('stty %s', $sttyMode)); - } - - return strlen($ret) > 0 ? $ret : $default; - } - - /** - * Asks a confirmation to the user. - * - * The question will be asked until the user answers by nothing, yes, or no. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param bool $default The default answer if the user enters nothing - * - * @return bool true if the user has confirmed, false otherwise - */ - public function askConfirmation(OutputInterface $output, $question, $default = true) - { - $answer = 'z'; - while ($answer && !in_array(strtolower($answer[0]), array('y', 'n'))) { - $answer = $this->ask($output, $question); - } - - if (false === $default) { - return $answer && 'y' == strtolower($answer[0]); - } - - return !$answer || 'y' == strtolower($answer[0]); - } - - /** - * Asks a question to the user, the response is hidden. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question - * @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not - * - * @return string The answer - * - * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden - */ - public function askHiddenResponse(OutputInterface $output, $question, $fallback = true) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - if ('\\' === DIRECTORY_SEPARATOR) { - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; - - // handle code running from a phar - if ('phar:' === substr(__FILE__, 0, 5)) { - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; - copy($exe, $tmpExe); - $exe = $tmpExe; - } - - $output->write($question); - $value = rtrim(shell_exec($exe)); - $output->writeln(''); - - if (isset($tmpExe)) { - unlink($tmpExe); - } - - return $value; - } - - if ($this->hasSttyAvailable()) { - $output->write($question); - - $sttyMode = shell_exec('stty -g'); - - shell_exec('stty -echo'); - $value = fgets($this->inputStream ?: STDIN, 4096); - shell_exec(sprintf('stty %s', $sttyMode)); - - if (false === $value) { - throw new \RuntimeException('Aborted'); - } - - $value = trim($value); - $output->writeln(''); - - return $value; - } - - if (false !== $shell = $this->getShell()) { - $output->write($question); - $readCmd = 'csh' === $shell ? 'set mypassword = $<' : 'read -r mypassword'; - $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); - $value = rtrim(shell_exec($command)); - $output->writeln(''); - - return $value; - } - - if ($fallback) { - return $this->ask($output, $question); - } - - throw new \RuntimeException('Unable to hide the response'); - } - - /** - * Asks for a value and validates the response. - * - * The validator receives the data to validate. It must return the - * validated data when the data is valid and throw an exception - * otherwise. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param callable $validator A PHP callback - * @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite) - * @param string $default The default answer if none is given by the user - * @param array $autocomplete List of values to autocomplete - * - * @return mixed - * - * @throws \Exception When any of the validators return an error - */ - public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null, array $autocomplete = null) - { - $that = $this; - - $interviewer = function () use ($output, $question, $default, $autocomplete, $that) { - return $that->ask($output, $question, $default, $autocomplete); - }; - - return $this->validateAttempts($interviewer, $output, $validator, $attempts); - } - - /** - * Asks for a value, hide and validates the response. - * - * The validator receives the data to validate. It must return the - * validated data when the data is valid and throw an exception - * otherwise. - * - * @param OutputInterface $output An Output instance - * @param string|array $question The question to ask - * @param callable $validator A PHP callback - * @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite) - * @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not - * - * @return string The response - * - * @throws \Exception When any of the validators return an error - * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden - */ - public function askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true) - { - $that = $this; - - $interviewer = function () use ($output, $question, $fallback, $that) { - return $that->askHiddenResponse($output, $question, $fallback); - }; - - return $this->validateAttempts($interviewer, $output, $validator, $attempts); - } - - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setInputStream($stream) - { - $this->inputStream = $stream; - } - - /** - * Returns the helper's input stream. - * - * @return resource|null The input stream or null if the default STDIN is used - */ - public function getInputStream() - { - return $this->inputStream; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'dialog'; - } - - /** - * Return a valid Unix shell. - * - * @return string|bool The valid shell name, false in case no valid shell is found - */ - private function getShell() - { - if (null !== self::$shell) { - return self::$shell; - } - - self::$shell = false; - - if (file_exists('/usr/bin/env')) { - // handle other OSs with bash/zsh/ksh/csh if available to hide the answer - $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null"; - foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) { - if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) { - self::$shell = $sh; - break; - } - } - } - - return self::$shell; - } - - private function hasSttyAvailable() - { - if (null !== self::$stty) { - return self::$stty; - } - - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; - } - - /** - * Validate an attempt. - * - * @param callable $interviewer A callable that will ask for a question and return the result - * @param OutputInterface $output An Output instance - * @param callable $validator A PHP callback - * @param int|false $attempts Max number of times to ask before giving up; false will ask infinitely - * - * @return string The validated response - * - * @throws \Exception In case the max number of attempts has been reached and no valid response has been given - */ - private function validateAttempts($interviewer, OutputInterface $output, $validator, $attempts) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $e = null; - while (false === $attempts || $attempts--) { - if (null !== $e) { - $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($e->getMessage(), 'error')); - } - - try { - return call_user_func($validator, $interviewer()); - } catch (\Exception $e) { - } - } - - throw $e; - } -} diff --git a/application/vendor/symfony/console/Helper/Helper.php b/application/vendor/symfony/console/Helper/Helper.php index 8bf82a1..43f9a16 100644 --- a/application/vendor/symfony/console/Helper/Helper.php +++ b/application/vendor/symfony/console/Helper/Helper.php @@ -23,7 +23,9 @@ abstract class Helper implements HelperInterface protected $helperSet = null; /** - * {@inheritdoc} + * Sets the helper set associated with this helper. + * + * @param HelperSet $helperSet A HelperSet instance */ public function setHelperSet(HelperSet $helperSet = null) { @@ -31,7 +33,9 @@ public function setHelperSet(HelperSet $helperSet = null) } /** - * {@inheritdoc} + * Gets the helper set associated with this helper. + * + * @return HelperSet A HelperSet instance */ public function getHelperSet() { @@ -47,10 +51,6 @@ public function getHelperSet() */ public static function strlen($string) { - if (!function_exists('mb_strwidth')) { - return strlen($string); - } - if (false === $encoding = mb_detect_encoding($string, null, true)) { return strlen($string); } @@ -105,11 +105,6 @@ public static function formatMemory($memory) } public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) - { - return self::strlen(self::removeDecoration($formatter, $string)); - } - - public static function removeDecoration(OutputFormatterInterface $formatter, $string) { $isDecorated = $formatter->isDecorated(); $formatter->setDecorated(false); @@ -119,6 +114,6 @@ public static function removeDecoration(OutputFormatterInterface $formatter, $st $string = preg_replace("/\033\[[^m]*m/", '', $string); $formatter->setDecorated($isDecorated); - return $string; + return self::strlen($string); } } diff --git a/application/vendor/symfony/console/Helper/HelperInterface.php b/application/vendor/symfony/console/Helper/HelperInterface.php index 1ce8235..5a923e0 100644 --- a/application/vendor/symfony/console/Helper/HelperInterface.php +++ b/application/vendor/symfony/console/Helper/HelperInterface.php @@ -20,6 +20,8 @@ interface HelperInterface { /** * Sets the helper set associated with this helper. + * + * @param HelperSet $helperSet A HelperSet instance */ public function setHelperSet(HelperSet $helperSet = null); diff --git a/application/vendor/symfony/console/Helper/HelperSet.php b/application/vendor/symfony/console/Helper/HelperSet.php index 6ae1627..6f12b39 100644 --- a/application/vendor/symfony/console/Helper/HelperSet.php +++ b/application/vendor/symfony/console/Helper/HelperSet.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\InvalidArgumentException; /** * HelperSet represents a set of helpers to be used with a command. @@ -27,6 +28,8 @@ class HelperSet implements \IteratorAggregate private $command; /** + * Constructor. + * * @param Helper[] $helpers An array of helper */ public function __construct(array $helpers = array()) @@ -71,25 +74,22 @@ public function has($name) * * @return HelperInterface The helper instance * - * @throws \InvalidArgumentException if the helper is not defined + * @throws InvalidArgumentException if the helper is not defined */ public function get($name) { if (!$this->has($name)) { - throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - if ('dialog' === $name && $this->helpers[$name] instanceof DialogHelper) { - @trigger_error('"Symfony\Component\Console\Helper\DialogHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED); - } elseif ('progress' === $name && $this->helpers[$name] instanceof ProgressHelper) { - @trigger_error('"Symfony\Component\Console\Helper\ProgressHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\ProgressBar" instead.', E_USER_DEPRECATED); - } elseif ('table' === $name && $this->helpers[$name] instanceof TableHelper) { - @trigger_error('"Symfony\Component\Console\Helper\TableHelper" is deprecated since Symfony 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\Table" instead.', E_USER_DEPRECATED); + throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); } return $this->helpers[$name]; } + /** + * Sets the command associated with this helper set. + * + * @param Command $command A Command instance + */ public function setCommand(Command $command = null) { $this->command = $command; diff --git a/application/vendor/symfony/console/Helper/ProcessHelper.php b/application/vendor/symfony/console/Helper/ProcessHelper.php index a811eb4..2c46a2c 100644 --- a/application/vendor/symfony/console/Helper/ProcessHelper.php +++ b/application/vendor/symfony/console/Helper/ProcessHelper.php @@ -36,7 +36,7 @@ class ProcessHelper extends Helper * * @return Process The process that ran */ - public function run(OutputInterface $output, $cmd, $error = null, $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) + public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); @@ -92,7 +92,7 @@ public function run(OutputInterface $output, $cmd, $error = null, $callback = nu * * @see run() */ - public function mustRun(OutputInterface $output, $cmd, $error = null, $callback = null) + public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null) { $process = $this->run($output, $cmd, $error, $callback); @@ -112,7 +112,7 @@ public function mustRun(OutputInterface $output, $cmd, $error = null, $callback * * @return callable */ - public function wrapCallback(OutputInterface $output, Process $process, $callback = null) + public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null) { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); @@ -120,10 +120,8 @@ public function wrapCallback(OutputInterface $output, Process $process, $callbac $formatter = $this->getHelperSet()->get('debug_formatter'); - $that = $this; - - return function ($type, $buffer) use ($output, $process, $callback, $formatter, $that) { - $output->write($formatter->progress(spl_object_hash($process), $that->escapeString($buffer), Process::ERR === $type)); + return function ($type, $buffer) use ($output, $process, $callback, $formatter) { + $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); if (null !== $callback) { call_user_func($callback, $type, $buffer); @@ -131,12 +129,7 @@ public function wrapCallback(OutputInterface $output, Process $process, $callbac }; } - /** - * This method is public for PHP 5.3 compatibility, it should be private. - * - * @internal - */ - public function escapeString($str) + private function escapeString($str) { return str_replace('<', '\\<', $str); } diff --git a/application/vendor/symfony/console/Helper/ProgressBar.php b/application/vendor/symfony/console/Helper/ProgressBar.php index 4d4c0e3..6aea12e 100644 --- a/application/vendor/symfony/console/Helper/ProgressBar.php +++ b/application/vendor/symfony/console/Helper/ProgressBar.php @@ -13,6 +13,7 @@ use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Exception\LogicException; /** * The ProgressBar provides helpers to display progress output. @@ -22,6 +23,7 @@ */ class ProgressBar { + // options private $barWidth = 28; private $barChar; private $emptyBarChar = '-'; @@ -29,6 +31,10 @@ class ProgressBar private $format; private $internalFormat; private $redrawFreq = 1; + + /** + * @var OutputInterface + */ private $output; private $step = 0; private $max; @@ -44,6 +50,8 @@ class ProgressBar private static $formats; /** + * Constructor. + * * @param OutputInterface $output An OutputInterface instance * @param int $max Maximum steps (0 if unknown) */ @@ -75,7 +83,7 @@ public function __construct(OutputInterface $output, $max = 0) * @param string $name The placeholder name (including the delimiter char like %) * @param callable $callable A PHP callable */ - public static function setPlaceholderFormatterDefinition($name, $callable) + public static function setPlaceholderFormatterDefinition($name, callable $callable) { if (!self::$formatters) { self::$formatters = self::initPlaceholderFormatters(); @@ -173,20 +181,6 @@ public function getMaxSteps() return $this->max; } - /** - * Gets the progress bar step. - * - * @deprecated since version 2.6, to be removed in 3.0. Use {@link getProgress()} instead. - * - * @return int The progress bar step - */ - public function getStep() - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the getProgress() method instead.', E_USER_DEPRECATED); - - return $this->getProgress(); - } - /** * Gets the current step position. * @@ -200,11 +194,9 @@ public function getProgress() /** * Gets the progress bar step width. * - * @internal This method is public for PHP 5.3 compatibility, it should not be used. - * * @return int The progress bar step width */ - public function getStepWidth() + private function getStepWidth() { return $this->stepWidth; } @@ -347,29 +339,13 @@ public function start($max = null) * * @param int $step Number of steps to advance * - * @throws \LogicException + * @throws LogicException */ public function advance($step = 1) { $this->setProgress($this->step + $step); } - /** - * Sets the current progress. - * - * @deprecated since version 2.6, to be removed in 3.0. Use {@link setProgress()} instead. - * - * @param int $step The current progress - * - * @throws \LogicException - */ - public function setCurrent($step) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the setProgress() method instead.', E_USER_DEPRECATED); - - $this->setProgress($step); - } - /** * Sets whether to overwrite the progressbar, false for new line. * @@ -385,13 +361,13 @@ public function setOverwrite($overwrite) * * @param int $step The current progress * - * @throws \LogicException + * @throws LogicException */ public function setProgress($step) { $step = (int) $step; if ($step < $this->step) { - throw new \LogicException('You can\'t regress the progress bar.'); + throw new LogicException('You can\'t regress the progress bar.'); } if ($this->max && $step > $this->max) { @@ -437,15 +413,11 @@ public function display() $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); } - // these 3 variables can be removed in favor of using $this in the closure when support for PHP 5.3 will be dropped. - $self = $this; - $output = $this->output; - $messages = $this->messages; - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self, $output, $messages) { - if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) { - $text = call_user_func($formatter, $self, $output); - } elseif (isset($messages[$matches[1]])) { - $text = $messages[$matches[1]]; + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { + if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { + $text = call_user_func($formatter, $this, $this->output); + } elseif (isset($this->messages[$matches[1]])) { + $text = $this->messages[$matches[1]]; } else { return $matches[0]; } @@ -570,7 +542,7 @@ private static function initPlaceholderFormatters() }, 'remaining' => function (ProgressBar $bar) { if (!$bar->getMaxSteps()) { - throw new \LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); + throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); } if (!$bar->getProgress()) { @@ -583,7 +555,7 @@ private static function initPlaceholderFormatters() }, 'estimated' => function (ProgressBar $bar) { if (!$bar->getMaxSteps()) { - throw new \LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); + throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); } if (!$bar->getProgress()) { diff --git a/application/vendor/symfony/console/Helper/ProgressHelper.php b/application/vendor/symfony/console/Helper/ProgressHelper.php deleted file mode 100644 index 20b3468..0000000 --- a/application/vendor/symfony/console/Helper/ProgressHelper.php +++ /dev/null @@ -1,468 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * The Progress class provides helpers to display progress output. - * - * @author Chris Jones - * @author Fabien Potencier - * - * @deprecated since version 2.5, to be removed in 3.0 - * Use {@link ProgressBar} instead. - */ -class ProgressHelper extends Helper -{ - const FORMAT_QUIET = ' %percent%%'; - const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%'; - const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%'; - const FORMAT_QUIET_NOMAX = ' %current%'; - const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]'; - const FORMAT_VERBOSE_NOMAX = ' %current% [%bar%] Elapsed: %elapsed%'; - - // options - private $barWidth = 28; - private $barChar = '='; - private $emptyBarChar = '-'; - private $progressChar = '>'; - private $format = null; - private $redrawFreq = 1; - - private $lastMessagesLength; - private $barCharOriginal; - - /** - * @var OutputInterface - */ - private $output; - - /** - * Current step. - * - * @var int - */ - private $current; - - /** - * Maximum number of steps. - * - * @var int - */ - private $max; - - /** - * Start time of the progress bar. - * - * @var int - */ - private $startTime; - - /** - * List of formatting variables. - * - * @var array - */ - private $defaultFormatVars = array( - 'current', - 'max', - 'bar', - 'percent', - 'elapsed', - ); - - /** - * Available formatting variables. - * - * @var array - */ - private $formatVars; - - /** - * Stored format part widths (used for padding). - * - * @var array - */ - private $widths = array( - 'current' => 4, - 'max' => 4, - 'percent' => 3, - 'elapsed' => 6, - ); - - /** - * Various time formats. - * - * @var array - */ - private $timeFormats = array( - array(0, '???'), - array(2, '1 sec'), - array(59, 'secs', 1), - array(60, '1 min'), - array(3600, 'mins', 60), - array(5400, '1 hr'), - array(86400, 'hrs', 3600), - array(129600, '1 day'), - array(604800, 'days', 86400), - ); - - public function __construct($triggerDeprecationError = true) - { - if ($triggerDeprecationError) { - @trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\ProgressBar class instead.', E_USER_DEPRECATED); - } - } - - /** - * Sets the progress bar width. - * - * @param int $size The progress bar size - */ - public function setBarWidth($size) - { - $this->barWidth = (int) $size; - } - - /** - * Sets the bar character. - * - * @param string $char A character - */ - public function setBarCharacter($char) - { - $this->barChar = $char; - } - - /** - * Sets the empty bar character. - * - * @param string $char A character - */ - public function setEmptyBarCharacter($char) - { - $this->emptyBarChar = $char; - } - - /** - * Sets the progress bar character. - * - * @param string $char A character - */ - public function setProgressCharacter($char) - { - $this->progressChar = $char; - } - - /** - * Sets the progress bar format. - * - * @param string $format The format - */ - public function setFormat($format) - { - $this->format = $format; - } - - /** - * Sets the redraw frequency. - * - * @param int $freq The frequency in steps - */ - public function setRedrawFrequency($freq) - { - $this->redrawFreq = (int) $freq; - } - - /** - * Starts the progress output. - * - * @param OutputInterface $output An Output instance - * @param int|null $max Maximum steps - */ - public function start(OutputInterface $output, $max = null) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $this->startTime = time(); - $this->current = 0; - $this->max = (int) $max; - - // Disabling output when it does not support ANSI codes as it would result in a broken display anyway. - $this->output = $output->isDecorated() ? $output : new NullOutput(); - $this->lastMessagesLength = 0; - $this->barCharOriginal = ''; - - if (null === $this->format) { - switch ($output->getVerbosity()) { - case OutputInterface::VERBOSITY_QUIET: - $this->format = self::FORMAT_QUIET_NOMAX; - if ($this->max > 0) { - $this->format = self::FORMAT_QUIET; - } - break; - case OutputInterface::VERBOSITY_VERBOSE: - case OutputInterface::VERBOSITY_VERY_VERBOSE: - case OutputInterface::VERBOSITY_DEBUG: - $this->format = self::FORMAT_VERBOSE_NOMAX; - if ($this->max > 0) { - $this->format = self::FORMAT_VERBOSE; - } - break; - default: - $this->format = self::FORMAT_NORMAL_NOMAX; - if ($this->max > 0) { - $this->format = self::FORMAT_NORMAL; - } - break; - } - } - - $this->initialize(); - } - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - * @param bool $redraw Whether to redraw or not - * - * @throws \LogicException - */ - public function advance($step = 1, $redraw = false) - { - $this->setCurrent($this->current + $step, $redraw); - } - - /** - * Sets the current progress. - * - * @param int $current The current progress - * @param bool $redraw Whether to redraw or not - * - * @throws \LogicException - */ - public function setCurrent($current, $redraw = false) - { - if (null === $this->startTime) { - throw new \LogicException('You must start the progress bar before calling setCurrent().'); - } - - $current = (int) $current; - - if ($current < $this->current) { - throw new \LogicException('You can\'t regress the progress bar'); - } - - if (0 === $this->current) { - $redraw = true; - } - - $prevPeriod = (int) ($this->current / $this->redrawFreq); - - $this->current = $current; - - $currPeriod = (int) ($this->current / $this->redrawFreq); - if ($redraw || $prevPeriod !== $currPeriod || $this->max === $this->current) { - $this->display(); - } - } - - /** - * Outputs the current progress string. - * - * @param bool $finish Forces the end result - * - * @throws \LogicException - */ - public function display($finish = false) - { - if (null === $this->startTime) { - throw new \LogicException('You must start the progress bar before calling display().'); - } - - $message = $this->format; - foreach ($this->generate($finish) as $name => $value) { - $message = str_replace("%{$name}%", $value, $message); - } - $this->overwrite($this->output, $message); - } - - /** - * Removes the progress bar from the current line. - * - * This is useful if you wish to write some output - * while a progress bar is running. - * Call display() to show the progress bar again. - */ - public function clear() - { - $this->overwrite($this->output, ''); - } - - /** - * Finishes the progress output. - */ - public function finish() - { - if (null === $this->startTime) { - throw new \LogicException('You must start the progress bar before calling finish().'); - } - - if (null !== $this->startTime) { - if (!$this->max) { - $this->barChar = $this->barCharOriginal; - $this->display(true); - } - $this->startTime = null; - $this->output->writeln(''); - $this->output = null; - } - } - - /** - * Initializes the progress helper. - */ - private function initialize() - { - $this->formatVars = array(); - foreach ($this->defaultFormatVars as $var) { - if (false !== strpos($this->format, "%{$var}%")) { - $this->formatVars[$var] = true; - } - } - - if ($this->max > 0) { - $this->widths['max'] = $this->strlen($this->max); - $this->widths['current'] = $this->widths['max']; - } else { - $this->barCharOriginal = $this->barChar; - $this->barChar = $this->emptyBarChar; - } - } - - /** - * Generates the array map of format variables to values. - * - * @param bool $finish Forces the end result - * - * @return array Array of format vars and values - */ - private function generate($finish = false) - { - $vars = array(); - $percent = 0; - if ($this->max > 0) { - $percent = (float) $this->current / $this->max; - } - - if (isset($this->formatVars['bar'])) { - if ($this->max > 0) { - $completeBars = floor($percent * $this->barWidth); - } else { - if (!$finish) { - $completeBars = floor($this->current % $this->barWidth); - } else { - $completeBars = $this->barWidth; - } - } - - $emptyBars = $this->barWidth - $completeBars - $this->strlen($this->progressChar); - $bar = str_repeat($this->barChar, $completeBars); - if ($completeBars < $this->barWidth) { - $bar .= $this->progressChar; - $bar .= str_repeat($this->emptyBarChar, $emptyBars); - } - - $vars['bar'] = $bar; - } - - if (isset($this->formatVars['elapsed'])) { - $elapsed = time() - $this->startTime; - $vars['elapsed'] = str_pad($this->humaneTime($elapsed), $this->widths['elapsed'], ' ', STR_PAD_LEFT); - } - - if (isset($this->formatVars['current'])) { - $vars['current'] = str_pad($this->current, $this->widths['current'], ' ', STR_PAD_LEFT); - } - - if (isset($this->formatVars['max'])) { - $vars['max'] = $this->max; - } - - if (isset($this->formatVars['percent'])) { - $vars['percent'] = str_pad(floor($percent * 100), $this->widths['percent'], ' ', STR_PAD_LEFT); - } - - return $vars; - } - - /** - * Converts seconds into human-readable format. - * - * @param int $secs Number of seconds - * - * @return string Time in readable format - */ - private function humaneTime($secs) - { - $text = ''; - foreach ($this->timeFormats as $format) { - if ($secs < $format[0]) { - if (2 == count($format)) { - $text = $format[1]; - break; - } else { - $text = ceil($secs / $format[2]).' '.$format[1]; - break; - } - } - } - - return $text; - } - - /** - * Overwrites a previous message to the output. - * - * @param OutputInterface $output An Output instance - * @param string $message The message - */ - private function overwrite(OutputInterface $output, $message) - { - $length = $this->strlen($message); - - // append whitespace to match the last line's length - if (null !== $this->lastMessagesLength && $this->lastMessagesLength > $length) { - $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); - } - - // carriage return - $output->write("\x0D"); - $output->write($message); - - $this->lastMessagesLength = $this->strlen($message); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'progress'; - } -} diff --git a/application/vendor/symfony/console/Helper/ProgressIndicator.php b/application/vendor/symfony/console/Helper/ProgressIndicator.php new file mode 100644 index 0000000..f90a85c --- /dev/null +++ b/application/vendor/symfony/console/Helper/ProgressIndicator.php @@ -0,0 +1,288 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Console\Helper; + +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Output\OutputInterface; + +/** + * @author Kevin Bond + */ +class ProgressIndicator +{ + private $output; + private $startTime; + private $format; + private $message; + private $indicatorValues; + private $indicatorCurrent; + private $indicatorChangeInterval; + private $indicatorUpdateTime; + private $lastMessagesLength; + private $started = false; + + private static $formatters; + private static $formats; + + /** + * @param OutputInterface $output + * @param string|null $format Indicator format + * @param int $indicatorChangeInterval Change interval in milliseconds + * @param array|null $indicatorValues Animated indicator characters + */ + public function __construct(OutputInterface $output, $format = null, $indicatorChangeInterval = 100, $indicatorValues = null) + { + $this->output = $output; + + if (null === $format) { + $format = $this->determineBestFormat(); + } + + if (null === $indicatorValues) { + $indicatorValues = array('-', '\\', '|', '/'); + } + + $indicatorValues = array_values($indicatorValues); + + if (2 > count($indicatorValues)) { + throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); + } + + $this->format = self::getFormatDefinition($format); + $this->indicatorChangeInterval = $indicatorChangeInterval; + $this->indicatorValues = $indicatorValues; + $this->startTime = time(); + } + + /** + * Sets the current indicator message. + * + * @param string|null $message + */ + public function setMessage($message) + { + $this->message = $message; + + $this->display(); + } + + /** + * Starts the indicator output. + * + * @param $message + */ + public function start($message) + { + if ($this->started) { + throw new LogicException('Progress indicator already started.'); + } + + $this->message = $message; + $this->started = true; + $this->lastMessagesLength = 0; + $this->startTime = time(); + $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; + $this->indicatorCurrent = 0; + + $this->display(); + } + + /** + * Advances the indicator. + */ + public function advance() + { + if (!$this->started) { + throw new LogicException('Progress indicator has not yet been started.'); + } + + if (!$this->output->isDecorated()) { + return; + } + + $currentTime = $this->getCurrentTimeInMilliseconds(); + + if ($currentTime < $this->indicatorUpdateTime) { + return; + } + + $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; + ++$this->indicatorCurrent; + + $this->display(); + } + + /** + * Finish the indicator with message. + * + * @param $message + */ + public function finish($message) + { + if (!$this->started) { + throw new LogicException('Progress indicator has not yet been started.'); + } + + $this->message = $message; + $this->display(); + $this->output->writeln(''); + $this->started = false; + } + + /** + * Gets the format for a given name. + * + * @param string $name The format name + * + * @return string|null A format string + */ + public static function getFormatDefinition($name) + { + if (!self::$formats) { + self::$formats = self::initFormats(); + } + + return isset(self::$formats[$name]) ? self::$formats[$name] : null; + } + + /** + * Sets a placeholder formatter for a given name. + * + * This method also allow you to override an existing placeholder. + * + * @param string $name The placeholder name (including the delimiter char like %) + * @param callable $callable A PHP callable + */ + public static function setPlaceholderFormatterDefinition($name, $callable) + { + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } + + self::$formatters[$name] = $callable; + } + + /** + * Gets the placeholder formatter for a given name. + * + * @param string $name The placeholder name (including the delimiter char like %) + * + * @return callable|null A PHP callable + */ + public static function getPlaceholderFormatterDefinition($name) + { + if (!self::$formatters) { + self::$formatters = self::initPlaceholderFormatters(); + } + + return isset(self::$formatters[$name]) ? self::$formatters[$name] : null; + } + + private function display() + { + if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { + return; + } + + $self = $this; + + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self) { + if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) { + return call_user_func($formatter, $self); + } + + return $matches[0]; + }, $this->format)); + } + + private function determineBestFormat() + { + switch ($this->output->getVerbosity()) { + // OutputInterface::VERBOSITY_QUIET: display is disabled anyway + case OutputInterface::VERBOSITY_VERBOSE: + return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi'; + case OutputInterface::VERBOSITY_VERY_VERBOSE: + case OutputInterface::VERBOSITY_DEBUG: + return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi'; + default: + return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi'; + } + } + + /** + * Overwrites a previous message to the output. + * + * @param string $message The message + */ + private function overwrite($message) + { + // append whitespace to match the line's length + if (null !== $this->lastMessagesLength) { + if ($this->lastMessagesLength > Helper::strlenWithoutDecoration($this->output->getFormatter(), $message)) { + $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); + } + } + + if ($this->output->isDecorated()) { + $this->output->write("\x0D"); + $this->output->write($message); + } else { + $this->output->writeln($message); + } + + $this->lastMessagesLength = 0; + + $len = Helper::strlenWithoutDecoration($this->output->getFormatter(), $message); + + if ($len > $this->lastMessagesLength) { + $this->lastMessagesLength = $len; + } + } + + private function getCurrentTimeInMilliseconds() + { + return round(microtime(true) * 1000); + } + + private static function initPlaceholderFormatters() + { + return array( + 'indicator' => function (ProgressIndicator $indicator) { + return $indicator->indicatorValues[$indicator->indicatorCurrent % count($indicator->indicatorValues)]; + }, + 'message' => function (ProgressIndicator $indicator) { + return $indicator->message; + }, + 'elapsed' => function (ProgressIndicator $indicator) { + return Helper::formatTime(time() - $indicator->startTime); + }, + 'memory' => function () { + return Helper::formatMemory(memory_get_usage(true)); + }, + ); + } + + private static function initFormats() + { + return array( + 'normal' => ' %indicator% %message%', + 'normal_no_ansi' => ' %message%', + + 'verbose' => ' %indicator% %message% (%elapsed:6s%)', + 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', + + 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', + 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', + ); + } +} diff --git a/application/vendor/symfony/console/Helper/QuestionHelper.php b/application/vendor/symfony/console/Helper/QuestionHelper.php index 36187f8..c6f5a40 100644 --- a/application/vendor/symfony/console/Helper/QuestionHelper.php +++ b/application/vendor/symfony/console/Helper/QuestionHelper.php @@ -11,14 +11,14 @@ namespace Symfony\Component\Console\Helper; -use Symfony\Component\Console\Formatter\OutputFormatter; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Exception\RuntimeException; /** * The QuestionHelper class provides helpers to interact with the user. @@ -34,9 +34,13 @@ class QuestionHelper extends Helper /** * Asks a question to the user. * - * @return mixed The user answer + * @param InputInterface $input An InputInterface instance + * @param OutputInterface $output An OutputInterface instance + * @param Question $question The question to ask + * + * @return string The user answer * - * @throws \RuntimeException If there is no data to read in the input stream + * @throws RuntimeException If there is no data to read in the input stream */ public function ask(InputInterface $input, OutputInterface $output, Question $question) { @@ -45,12 +49,6 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu } if (!$input->isInteractive()) { - if ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - return $choices[$question->getDefault()]; - } - return $question->getDefault(); } @@ -58,10 +56,8 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu return $this->doAsk($output, $question); } - $that = $this; - - $interviewer = function () use ($output, $question, $that) { - return $that->doAsk($output, $question); + $interviewer = function () use ($output, $question) { + return $this->doAsk($output, $question); }; return $this->validateAttempts($interviewer, $output, $question); @@ -74,12 +70,12 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu * * @param resource $stream The input stream * - * @throws \InvalidArgumentException In case the stream is not a resource + * @throws InvalidArgumentException In case the stream is not a resource */ public function setInputStream($stream) { if (!is_resource($stream)) { - throw new \InvalidArgumentException('Input stream must be a valid resource.'); + throw new InvalidArgumentException('Input stream must be a valid resource.'); } $this->inputStream = $stream; @@ -106,14 +102,15 @@ public function getName() /** * Asks the question to the user. * - * This method is public for PHP 5.3 compatibility, it should be private. + * @param OutputInterface $output + * @param Question $question * * @return bool|mixed|null|string * * @throws \Exception * @throws \RuntimeException */ - public function doAsk(OutputInterface $output, Question $question) + private function doAsk(OutputInterface $output, Question $question) { $this->writePrompt($output, $question); @@ -135,12 +132,12 @@ public function doAsk(OutputInterface $output, Question $question) if (false === $ret) { $ret = fgets($inputStream, 4096); if (false === $ret) { - throw new RuntimeException('Aborted'); + throw new \RuntimeException('Aborted'); } $ret = trim($ret); } } else { - $ret = trim($this->autocomplete($output, $question, $inputStream, is_array($autocomplete) ? $autocomplete : iterator_to_array($autocomplete, false))); + $ret = trim($this->autocomplete($output, $question, $inputStream)); } $ret = strlen($ret) > 0 ? $ret : $question->getDefault(); @@ -154,6 +151,9 @@ public function doAsk(OutputInterface $output, Question $question) /** * Outputs the question prompt. + * + * @param OutputInterface $output + * @param Question $question */ protected function writePrompt(OutputInterface $output, Question $question) { @@ -178,6 +178,9 @@ protected function writePrompt(OutputInterface $output, Question $question) /** * Outputs an error message. + * + * @param OutputInterface $output + * @param \Exception $error */ protected function writeError(OutputInterface $output, \Exception $error) { @@ -195,13 +198,12 @@ protected function writeError(OutputInterface $output, \Exception $error) * * @param OutputInterface $output * @param Question $question - * @param resource $inputStream - * @param array $autocomplete * * @return string */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, array $autocomplete) + private function autocomplete(OutputInterface $output, Question $question, $inputStream) { + $autocomplete = $question->getAutocompleterValues(); $ret = ''; $i = 0; @@ -229,7 +231,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu $output->write("\033[1D"); } - if (0 === $i) { + if ($i === 0) { $ofs = -1; $matches = $autocomplete; $numMatches = count($matches); @@ -284,7 +286,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu foreach ($autocomplete as $value) { // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (0 === strpos($value, $ret)) { + if (0 === strpos($value, $ret) && $i !== strlen($value)) { $matches[$numMatches++] = $value; } } @@ -297,7 +299,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu // Save cursor position $output->write("\0337"); // Write highlighted text - $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $i)).''); + $output->write(''.substr($matches[$ofs], $i).''); // Restore cursor position $output->write("\0338"); } @@ -312,12 +314,11 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu /** * Gets a hidden response from user. * - * @param OutputInterface $output An Output instance - * @param resource $inputStream The handler resource + * @param OutputInterface $output An Output instance * * @return string The answer * - * @throws \RuntimeException In case the fallback is deactivated and the response cannot be hidden + * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden */ private function getHiddenResponse(OutputInterface $output, $inputStream) { @@ -359,7 +360,7 @@ private function getHiddenResponse(OutputInterface $output, $inputStream) } if (false !== $shell = $this->getShell()) { - $readCmd = 'csh' === $shell ? 'set mypassword = $<' : 'read -r mypassword'; + $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword'; $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); $value = rtrim(shell_exec($command)); $output->writeln(''); @@ -377,11 +378,11 @@ private function getHiddenResponse(OutputInterface $output, $inputStream) * @param OutputInterface $output An Output instance * @param Question $question A Question instance * - * @return mixed The validated response + * @return string The validated response * * @throws \Exception In case the max number of attempts has been reached and no valid response has been given */ - private function validateAttempts($interviewer, OutputInterface $output, Question $question) + private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question) { $error = null; $attempts = $question->getMaxAttempts(); @@ -392,8 +393,6 @@ private function validateAttempts($interviewer, OutputInterface $output, Questio try { return call_user_func($question->getValidator(), $interviewer()); - } catch (RuntimeException $e) { - throw $e; } catch (\Exception $error) { } } @@ -441,6 +440,6 @@ private function hasSttyAvailable() exec('stty 2>&1', $output, $exitcode); - return self::$stty = 0 === $exitcode; + return self::$stty = $exitcode === 0; } } diff --git a/application/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/application/vendor/symfony/console/Helper/SymfonyQuestionHelper.php index e51e422..aeddb76 100644 --- a/application/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ b/application/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -11,13 +11,13 @@ namespace Symfony\Component\Console\Helper; +use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Console\Formatter\OutputFormatter; /** * Symfony Style Guide compliant question helper. @@ -35,11 +35,11 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu $question->setValidator(function ($value) use ($validator) { if (null !== $validator) { $value = $validator($value); - } else { - // make required - if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) { - throw new \Exception('A value is required.'); - } + } + + // make required + if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) { + throw new LogicException('A value is required.'); } return $value; @@ -53,7 +53,7 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu */ protected function writePrompt(OutputInterface $output, Question $question) { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); + $text = $question->getQuestion(); $default = $question->getDefault(); switch (true) { @@ -75,18 +75,18 @@ protected function writePrompt(OutputInterface $output, Question $question) $default[$key] = $choices[trim($value)]; } - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); + $text = sprintf(' %s [%s]:', $text, implode(', ', $default)); break; case $question instanceof ChoiceQuestion: $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default])); + $text = sprintf(' %s [%s]:', $text, $choices[$default]); break; default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); + $text = sprintf(' %s [%s]:', $text, $default); } $output->writeln($text); diff --git a/application/vendor/symfony/console/Helper/Table.php b/application/vendor/symfony/console/Helper/Table.php index 15ad1ed..04aa98d 100644 --- a/application/vendor/symfony/console/Helper/Table.php +++ b/application/vendor/symfony/console/Helper/Table.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Exception\InvalidArgumentException; /** * Provides helpers to display a table. @@ -19,28 +20,35 @@ * @author Fabien Potencier * @author Саша Стаменковић * @author Abdellatif Ait boudad + * @author Max Grigorian */ class Table { /** * Table headers. + * + * @var array */ private $headers = array(); /** * Table rows. + * + * @var array */ private $rows = array(); /** * Column widths cache. + * + * @var array */ private $columnWidths = array(); /** * Number of columns cache. * - * @var int + * @var array */ private $numberOfColumns; @@ -54,6 +62,11 @@ class Table */ private $style; + /** + * @var array + */ + private $columnStyles = array(); + private static $styles; public function __construct(OutputInterface $output) @@ -87,7 +100,7 @@ public static function setStyleDefinition($name, TableStyle $style) * * @param string $name The style name * - * @return TableStyle + * @return TableStyle A TableStyle instance */ public static function getStyleDefinition($name) { @@ -99,7 +112,7 @@ public static function getStyleDefinition($name) return self::$styles[$name]; } - throw new \InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); } /** @@ -107,7 +120,7 @@ public static function getStyleDefinition($name) * * @param TableStyle|string $name The style name or a TableStyle instance * - * @return $this + * @return Table */ public function setStyle($name) { @@ -126,6 +139,41 @@ public function getStyle() return $this->style; } + /** + * Sets table column style. + * + * @param int $columnIndex Column index + * @param TableStyle|string $name The style name or a TableStyle instance + * + * @return Table + */ + public function setColumnStyle($columnIndex, $name) + { + $columnIndex = intval($columnIndex); + + $this->columnStyles[$columnIndex] = $this->resolveStyle($name); + + return $this; + } + + /** + * Gets the current style for a column. + * + * If style was not set, it returns the global table style. + * + * @param int $columnIndex Column index + * + * @return TableStyle + */ + public function getColumnStyle($columnIndex) + { + if (isset($this->columnStyles[$columnIndex])) { + return $this->columnStyles[$columnIndex]; + } + + return $this->getStyle(); + } + public function setHeaders(array $headers) { $headers = array_values($headers); @@ -163,7 +211,7 @@ public function addRow($row) } if (!is_array($row)) { - throw new \InvalidArgumentException('A row must be an array or a TableSeparator instance.'); + throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.'); } $this->rows[] = array_values($row); @@ -182,7 +230,6 @@ public function setRow($column, array $row) * Renders table to output. * * Example: - * * +---------------+-----------------------+------------------+ * | ISBN | Title | Author | * +---------------+-----------------------+------------------+ @@ -190,29 +237,30 @@ public function setRow($column, array $row) * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | * +---------------+-----------------------+------------------+ - * */ public function render() { $this->calculateNumberOfColumns(); - $this->rows = $this->buildTableRows($this->rows); - $this->headers = $this->buildTableRows($this->headers); + $rows = $this->buildTableRows($this->rows); + $headers = $this->buildTableRows($this->headers); + + $this->calculateColumnsWidth(array_merge($headers, $rows)); $this->renderRowSeparator(); - if (!empty($this->headers)) { - foreach ($this->headers as $header) { + if (!empty($headers)) { + foreach ($headers as $header) { $this->renderRow($header, $this->style->getCellHeaderFormat()); $this->renderRowSeparator(); } } - foreach ($this->rows as $row) { + foreach ($rows as $row) { if ($row instanceof TableSeparator) { $this->renderRowSeparator(); } else { $this->renderRow($row, $this->style->getCellRowFormat()); } } - if (!empty($this->rows)) { + if (!empty($rows)) { $this->renderRowSeparator(); } @@ -222,7 +270,7 @@ public function render() /** * Renders horizontal header separator. * - * Example: +-----+-----------+-------+ + * Example: +-----+-----------+-------+ */ private function renderRowSeparator() { @@ -236,7 +284,7 @@ private function renderRowSeparator() $markup = $this->style->getCrossingChar(); for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->getColumnWidth($column)).$this->style->getCrossingChar(); + $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->columnWidths[$column]).$this->style->getCrossingChar(); } $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); @@ -253,7 +301,7 @@ private function renderColumnSeparator() /** * Renders table row. * - * Example: | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | + * Example: | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | * * @param array $row * @param string $cellFormat @@ -282,27 +330,29 @@ private function renderRow(array $row, $cellFormat) private function renderCell(array $row, $column, $cellFormat) { $cell = isset($row[$column]) ? $row[$column] : ''; - $width = $this->getColumnWidth($column); + $width = $this->columnWidths[$column]; if ($cell instanceof TableCell && $cell->getColspan() > 1) { // add the width of the following columns(numbers of colspan). foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { - $width += $this->getColumnSeparatorWidth() + $this->getColumnWidth($nextColumn); + $width += $this->getColumnSeparatorWidth() + $this->columnWidths[$nextColumn]; } } // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (function_exists('mb_strwidth') && false !== $encoding = mb_detect_encoding($cell)) { + if (false !== $encoding = mb_detect_encoding($cell, null, true)) { $width += strlen($cell) - mb_strwidth($cell, $encoding); } + $style = $this->getColumnStyle($column); + if ($cell instanceof TableSeparator) { - return sprintf($this->style->getBorderFormat(), str_repeat($this->style->getHorizontalBorderChar(), $width)); + return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width)); } $width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell); - $content = sprintf($this->style->getCellRowContentFormat(), $cell); + $content = sprintf($style->getCellRowContentFormat(), $cell); - return sprintf($cellFormat, str_pad($content, $width, $this->style->getPaddingChar(), $this->style->getPadType())); + return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType())); } /** @@ -337,7 +387,7 @@ private function buildTableRows($rows) if (!strstr($cell, "\n")) { continue; } - $lines = explode("\n", str_replace("\n", "\n", $cell)); + $lines = explode("\n", $cell); foreach ($lines as $lineKey => $line) { if ($cell instanceof TableCell) { $line = new TableCell($line, array('colspan' => $cell->getColspan())); @@ -370,7 +420,7 @@ private function buildTableRows($rows) * * @return array */ - private function fillNextRows(array $rows, $line) + private function fillNextRows($rows, $line) { $unmergedRows = array(); foreach ($rows[$line] as $column => $cell) { @@ -378,7 +428,7 @@ private function fillNextRows(array $rows, $line) $nbLines = $cell->getRowspan() - 1; $lines = array($cell); if (strstr($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); + $lines = explode("\n", $cell); $nbLines = count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; $rows[$line][$column] = new TableCell($lines[0], array('colspan' => $cell->getColspan())); @@ -390,9 +440,6 @@ private function fillNextRows(array $rows, $line) foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : ''; $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan())); - if ($nbLines === $unmergedRowKey - $line) { - break; - } } } } @@ -421,6 +468,8 @@ private function fillNextRows(array $rows, $line) /** * fill cells for a row that contains colspan > 1. * + * @param array $row + * * @return array */ private function fillCells($row) @@ -445,7 +494,7 @@ private function fillCells($row) * * @return array */ - private function copyRow(array $rows, $line) + private function copyRow($rows, $line) { $row = $rows[$line]; foreach ($row as $cellKey => $cellValue) { @@ -461,6 +510,8 @@ private function copyRow(array $rows, $line) /** * Gets number of columns by row. * + * @param array $row + * * @return int */ private function getNumberOfColumns(array $row) @@ -476,9 +527,11 @@ private function getNumberOfColumns(array $row) /** * Gets list of columns for the given row. * + * @param array $row + * * @return array */ - private function getRowColumns(array $row) + private function getRowColumns($row) { $columns = range(0, $this->numberOfColumns - 1); foreach ($row as $cellKey => $cell) { @@ -492,42 +545,36 @@ private function getRowColumns(array $row) } /** - * Gets column width. - * - * @param int $column + * Calculates columns widths. * - * @return int + * @param array $rows */ - private function getColumnWidth($column) + private function calculateColumnsWidth($rows) { - if (isset($this->columnWidths[$column])) { - return $this->columnWidths[$column]; - } - - $lengths = array(); - - foreach (array_merge($this->headers, $this->rows) as $row) { - if ($row instanceof TableSeparator) { - continue; - } + for ($column = 0; $column < $this->numberOfColumns; ++$column) { + $lengths = array(); + foreach ($rows as $row) { + if ($row instanceof TableSeparator) { + continue; + } - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::strlen($textContent); - if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; + foreach ($row as $i => $cell) { + if ($cell instanceof TableCell) { + $textLength = strlen($cell); + if ($textLength > 0) { + $contentColumns = str_split($cell, ceil($textLength / $cell->getColspan())); + foreach ($contentColumns as $position => $content) { + $row[$i + $position] = $content; + } } } } + + $lengths[] = $this->getCellWidth($row, $column); } - $lengths[] = $this->getCellWidth($row, $column); + $this->columnWidths[$column] = max($lengths) + strlen($this->style->getCellRowContentFormat()) - 2; } - - return $this->columnWidths[$column] = max($lengths) + strlen($this->style->getCellRowContentFormat()) - 2; } /** @@ -612,6 +659,6 @@ private function resolveStyle($name) return self::$styles[$name]; } - throw new \InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); } } diff --git a/application/vendor/symfony/console/Helper/TableCell.php b/application/vendor/symfony/console/Helper/TableCell.php index 8562f72..69442d4 100644 --- a/application/vendor/symfony/console/Helper/TableCell.php +++ b/application/vendor/symfony/console/Helper/TableCell.php @@ -11,12 +11,21 @@ namespace Symfony\Component\Console\Helper; +use Symfony\Component\Console\Exception\InvalidArgumentException; + /** * @author Abdellatif Ait boudad */ class TableCell { + /** + * @var string + */ private $value; + + /** + * @var array + */ private $options = array( 'rowspan' => 1, 'colspan' => 1, @@ -28,15 +37,11 @@ class TableCell */ public function __construct($value = '', array $options = array()) { - if (is_numeric($value) && !is_string($value)) { - $value = (string) $value; - } - $this->value = $value; // check option names if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new \InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); + throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); } $this->options = array_merge($this->options, $options); diff --git a/application/vendor/symfony/console/Helper/TableHelper.php b/application/vendor/symfony/console/Helper/TableHelper.php deleted file mode 100644 index b03f51f..0000000 --- a/application/vendor/symfony/console/Helper/TableHelper.php +++ /dev/null @@ -1,263 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\NullOutput; - -/** - * Provides helpers to display table output. - * - * @author Саша Стаменковић - * @author Fabien Potencier - * - * @deprecated since version 2.5, to be removed in 3.0 - * Use {@link Table} instead. - */ -class TableHelper extends Helper -{ - const LAYOUT_DEFAULT = 0; - const LAYOUT_BORDERLESS = 1; - const LAYOUT_COMPACT = 2; - - private $table; - - public function __construct($triggerDeprecationError = true) - { - if ($triggerDeprecationError) { - @trigger_error('The '.__CLASS__.' class is deprecated since Symfony 2.5 and will be removed in 3.0. Use the Symfony\Component\Console\Helper\Table class instead.', E_USER_DEPRECATED); - } - - $this->table = new Table(new NullOutput()); - } - - /** - * Sets table layout type. - * - * @param int $layout self::LAYOUT_* - * - * @return $this - * - * @throws \InvalidArgumentException when the table layout is not known - */ - public function setLayout($layout) - { - switch ($layout) { - case self::LAYOUT_BORDERLESS: - $this->table->setStyle('borderless'); - break; - - case self::LAYOUT_COMPACT: - $this->table->setStyle('compact'); - break; - - case self::LAYOUT_DEFAULT: - $this->table->setStyle('default'); - break; - - default: - throw new \InvalidArgumentException(sprintf('Invalid table layout "%s".', $layout)); - } - - return $this; - } - - public function setHeaders(array $headers) - { - $this->table->setHeaders($headers); - - return $this; - } - - public function setRows(array $rows) - { - $this->table->setRows($rows); - - return $this; - } - - public function addRows(array $rows) - { - $this->table->addRows($rows); - - return $this; - } - - public function addRow(array $row) - { - $this->table->addRow($row); - - return $this; - } - - public function setRow($column, array $row) - { - $this->table->setRow($column, $row); - - return $this; - } - - /** - * Sets padding character, used for cell padding. - * - * @param string $paddingChar - * - * @return $this - */ - public function setPaddingChar($paddingChar) - { - $this->table->getStyle()->setPaddingChar($paddingChar); - - return $this; - } - - /** - * Sets horizontal border character. - * - * @param string $horizontalBorderChar - * - * @return $this - */ - public function setHorizontalBorderChar($horizontalBorderChar) - { - $this->table->getStyle()->setHorizontalBorderChar($horizontalBorderChar); - - return $this; - } - - /** - * Sets vertical border character. - * - * @param string $verticalBorderChar - * - * @return $this - */ - public function setVerticalBorderChar($verticalBorderChar) - { - $this->table->getStyle()->setVerticalBorderChar($verticalBorderChar); - - return $this; - } - - /** - * Sets crossing character. - * - * @param string $crossingChar - * - * @return $this - */ - public function setCrossingChar($crossingChar) - { - $this->table->getStyle()->setCrossingChar($crossingChar); - - return $this; - } - - /** - * Sets header cell format. - * - * @param string $cellHeaderFormat - * - * @return $this - */ - public function setCellHeaderFormat($cellHeaderFormat) - { - $this->table->getStyle()->setCellHeaderFormat($cellHeaderFormat); - - return $this; - } - - /** - * Sets row cell format. - * - * @param string $cellRowFormat - * - * @return $this - */ - public function setCellRowFormat($cellRowFormat) - { - $this->table->getStyle()->setCellHeaderFormat($cellRowFormat); - - return $this; - } - - /** - * Sets row cell content format. - * - * @param string $cellRowContentFormat - * - * @return $this - */ - public function setCellRowContentFormat($cellRowContentFormat) - { - $this->table->getStyle()->setCellRowContentFormat($cellRowContentFormat); - - return $this; - } - - /** - * Sets table border format. - * - * @param string $borderFormat - * - * @return $this - */ - public function setBorderFormat($borderFormat) - { - $this->table->getStyle()->setBorderFormat($borderFormat); - - return $this; - } - - /** - * Sets cell padding type. - * - * @param int $padType STR_PAD_* - * - * @return $this - */ - public function setPadType($padType) - { - $this->table->getStyle()->setPadType($padType); - - return $this; - } - - /** - * Renders table to output. - * - * Example: - * +---------------+-----------------------+------------------+ - * | ISBN | Title | Author | - * +---------------+-----------------------+------------------+ - * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | - * +---------------+-----------------------+------------------+ - */ - public function render(OutputInterface $output) - { - $p = new \ReflectionProperty($this->table, 'output'); - $p->setAccessible(true); - $p->setValue($this->table, $output); - - $this->table->render(); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'table'; - } -} diff --git a/application/vendor/symfony/console/Helper/TableSeparator.php b/application/vendor/symfony/console/Helper/TableSeparator.php index c7b8dc9..8cc73e6 100644 --- a/application/vendor/symfony/console/Helper/TableSeparator.php +++ b/application/vendor/symfony/console/Helper/TableSeparator.php @@ -18,6 +18,9 @@ */ class TableSeparator extends TableCell { + /** + * @param array $options + */ public function __construct(array $options = array()) { parent::__construct('', $options); diff --git a/application/vendor/symfony/console/Helper/TableStyle.php b/application/vendor/symfony/console/Helper/TableStyle.php index b00f12e..d7e28ff 100644 --- a/application/vendor/symfony/console/Helper/TableStyle.php +++ b/application/vendor/symfony/console/Helper/TableStyle.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Helper; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + /** * Defines the styles for a Table. * @@ -34,12 +37,12 @@ class TableStyle * * @param string $paddingChar * - * @return $this + * @return TableStyle */ public function setPaddingChar($paddingChar) { if (!$paddingChar) { - throw new \LogicException('The padding char must not be empty'); + throw new LogicException('The padding char must not be empty'); } $this->paddingChar = $paddingChar; @@ -62,7 +65,7 @@ public function getPaddingChar() * * @param string $horizontalBorderChar * - * @return $this + * @return TableStyle */ public function setHorizontalBorderChar($horizontalBorderChar) { @@ -86,7 +89,7 @@ public function getHorizontalBorderChar() * * @param string $verticalBorderChar * - * @return $this + * @return TableStyle */ public function setVerticalBorderChar($verticalBorderChar) { @@ -110,7 +113,7 @@ public function getVerticalBorderChar() * * @param string $crossingChar * - * @return $this + * @return TableStyle */ public function setCrossingChar($crossingChar) { @@ -134,7 +137,7 @@ public function getCrossingChar() * * @param string $cellHeaderFormat * - * @return $this + * @return TableStyle */ public function setCellHeaderFormat($cellHeaderFormat) { @@ -158,7 +161,7 @@ public function getCellHeaderFormat() * * @param string $cellRowFormat * - * @return $this + * @return TableStyle */ public function setCellRowFormat($cellRowFormat) { @@ -182,7 +185,7 @@ public function getCellRowFormat() * * @param string $cellRowContentFormat * - * @return $this + * @return TableStyle */ public function setCellRowContentFormat($cellRowContentFormat) { @@ -206,7 +209,7 @@ public function getCellRowContentFormat() * * @param string $borderFormat * - * @return $this + * @return TableStyle */ public function setBorderFormat($borderFormat) { @@ -230,12 +233,12 @@ public function getBorderFormat() * * @param int $padType STR_PAD_* * - * @return $this + * @return TableStyle */ public function setPadType($padType) { if (!in_array($padType, array(STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH), true)) { - throw new \InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); + throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); } $this->padType = $padType; diff --git a/application/vendor/symfony/console/Input/ArgvInput.php b/application/vendor/symfony/console/Input/ArgvInput.php index 62c658b..cb0a8aa 100644 --- a/application/vendor/symfony/console/Input/ArgvInput.php +++ b/application/vendor/symfony/console/Input/ArgvInput.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\RuntimeException; + /** * ArgvInput represents an input coming from the CLI arguments. * @@ -42,6 +44,8 @@ class ArgvInput extends Input private $parsed; /** + * Constructor. + * * @param array|null $argv An array of parameters from the CLI (in the argv format) * @param InputDefinition|null $definition A InputDefinition instance */ @@ -112,14 +116,14 @@ private function parseShortOption($token) * * @param string $name The current token * - * @throws \RuntimeException When option given doesn't exist + * @throws RuntimeException When option given doesn't exist */ private function parseShortOptionSet($name) { $len = strlen($name); for ($i = 0; $i < $len; ++$i) { if (!$this->definition->hasShortcut($name[$i])) { - throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); + throw new RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); } $option = $this->definition->getOptionForShortcut($name[$i]); @@ -143,10 +147,7 @@ private function parseLongOption($token) $name = substr($token, 2); if (false !== $pos = strpos($name, '=')) { - if (0 === strlen($value = substr($name, $pos + 1))) { - array_unshift($this->parsed, null); - } - $this->addLongOption(substr($name, 0, $pos), $value); + $this->addLongOption(substr($name, 0, $pos), substr($name, $pos + 1)); } else { $this->addLongOption($name, null); } @@ -157,7 +158,7 @@ private function parseLongOption($token) * * @param string $token The current token * - * @throws \RuntimeException When too many arguments are given + * @throws RuntimeException When too many arguments are given */ private function parseArgument($token) { @@ -177,10 +178,10 @@ private function parseArgument($token) } else { $all = $this->definition->getArguments(); if (count($all)) { - throw new \RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all)))); + throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all)))); } - throw new \RuntimeException(sprintf('No arguments expected, got "%s".', $token)); + throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token)); } } @@ -190,12 +191,12 @@ private function parseArgument($token) * @param string $shortcut The short option key * @param mixed $value The value for the option * - * @throws \RuntimeException When option given doesn't exist + * @throws RuntimeException When option given doesn't exist */ private function addShortOption($shortcut, $value) { if (!$this->definition->hasShortcut($shortcut)) { - throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); } $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); @@ -207,12 +208,12 @@ private function addShortOption($shortcut, $value) * @param string $name The long option key * @param mixed $value The value for the option * - * @throws \RuntimeException When option given doesn't exist + * @throws RuntimeException When option given doesn't exist */ private function addLongOption($name, $value) { if (!$this->definition->hasOption($name)) { - throw new \RuntimeException(sprintf('The "--%s" option does not exist.', $name)); + throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); } $option = $this->definition->getOption($name); @@ -223,7 +224,7 @@ private function addLongOption($name, $value) } if (null !== $value && !$option->acceptValue()) { - throw new \RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); } if (null === $value && $option->acceptValue() && count($this->parsed)) { @@ -233,7 +234,7 @@ private function addLongOption($name, $value) if (isset($next[0]) && '-' !== $next[0]) { $value = $next; } elseif (empty($next)) { - $value = null; + $value = ''; } else { array_unshift($this->parsed, $next); } @@ -241,7 +242,7 @@ private function addLongOption($name, $value) if (null === $value) { if ($option->isValueRequired()) { - throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); } if (!$option->isArray()) { @@ -273,17 +274,16 @@ public function getFirstArgument() /** * {@inheritdoc} */ - public function hasParameterOption($values) + public function hasParameterOption($values, $onlyParams = false) { $values = (array) $values; foreach ($this->tokens as $token) { + if ($onlyParams && $token === '--') { + return false; + } foreach ($values as $value) { - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = 0 === strpos($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && 0 === strpos($token, $leading)) { + if ($token === $value || 0 === strpos($token, $value.'=')) { return true; } } @@ -295,25 +295,25 @@ public function hasParameterOption($values) /** * {@inheritdoc} */ - public function getParameterOption($values, $default = false) + public function getParameterOption($values, $default = false, $onlyParams = false) { $values = (array) $values; $tokens = $this->tokens; while (0 < count($tokens)) { $token = array_shift($tokens); + if ($onlyParams && $token === '--') { + return false; + } foreach ($values as $value) { - if ($token === $value) { + if ($token === $value || 0 === strpos($token, $value.'=')) { + if (false !== $pos = strpos($token, '=')) { + return substr($token, $pos + 1); + } + return array_shift($tokens); } - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = 0 === strpos($value, '--') ? $value.'=' : $value; - if ('' !== $leading && 0 === strpos($token, $leading)) { - return substr($token, strlen($leading)); - } } } @@ -327,14 +327,13 @@ public function getParameterOption($values, $default = false) */ public function __toString() { - $self = $this; - $tokens = array_map(function ($token) use ($self) { + $tokens = array_map(function ($token) { if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1].$self->escapeToken($match[2]); + return $match[1].$this->escapeToken($match[2]); } - if ($token && '-' !== $token[0]) { - return $self->escapeToken($token); + if ($token && $token[0] !== '-') { + return $this->escapeToken($token); } return $token; diff --git a/application/vendor/symfony/console/Input/ArrayInput.php b/application/vendor/symfony/console/Input/ArrayInput.php index eb921fd..a44b6b2 100644 --- a/application/vendor/symfony/console/Input/ArrayInput.php +++ b/application/vendor/symfony/console/Input/ArrayInput.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\InvalidOptionException; + /** * ArrayInput represents an input provided as an array. * @@ -24,6 +27,12 @@ class ArrayInput extends Input { private $parameters; + /** + * Constructor. + * + * @param array $parameters An array of parameters + * @param InputDefinition|null $definition A InputDefinition instance + */ public function __construct(array $parameters, InputDefinition $definition = null) { $this->parameters = $parameters; @@ -48,7 +57,7 @@ public function getFirstArgument() /** * {@inheritdoc} */ - public function hasParameterOption($values) + public function hasParameterOption($values, $onlyParams = false) { $values = (array) $values; @@ -57,6 +66,10 @@ public function hasParameterOption($values) $v = $k; } + if ($onlyParams && $v === '--') { + return false; + } + if (in_array($v, $values)) { return true; } @@ -68,11 +81,15 @@ public function hasParameterOption($values) /** * {@inheritdoc} */ - public function getParameterOption($values, $default = false) + public function getParameterOption($values, $default = false, $onlyParams = false) { $values = (array) $values; foreach ($this->parameters as $k => $v) { + if ($onlyParams && ($k === '--' || (is_int($k) && $v === '--'))) { + return false; + } + if (is_int($k)) { if (in_array($v, $values)) { return true; @@ -95,15 +112,9 @@ public function __toString() $params = array(); foreach ($this->parameters as $param => $val) { if ($param && '-' === $param[0]) { - if (is_array($val)) { - foreach ($val as $v) { - $params[] = $param.('' != $v ? '='.$this->escapeToken($v) : ''); - } - } else { - $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); - } + $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); } else { - $params[] = is_array($val) ? implode(' ', array_map(array($this, 'escapeToken'), $val)) : $this->escapeToken($val); + $params[] = $this->escapeToken($val); } } @@ -116,6 +127,9 @@ public function __toString() protected function parse() { foreach ($this->parameters as $key => $value) { + if ($key === '--') { + return; + } if (0 === strpos($key, '--')) { $this->addLongOption(substr($key, 2), $value); } elseif ('-' === $key[0]) { @@ -132,12 +146,12 @@ protected function parse() * @param string $shortcut The short option key * @param mixed $value The value for the option * - * @throws \InvalidArgumentException When option given doesn't exist + * @throws InvalidOptionException When option given doesn't exist */ private function addShortOption($shortcut, $value) { if (!$this->definition->hasShortcut($shortcut)) { - throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); } $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); @@ -149,20 +163,20 @@ private function addShortOption($shortcut, $value) * @param string $name The long option key * @param mixed $value The value for the option * - * @throws \InvalidArgumentException When option given doesn't exist - * @throws \InvalidArgumentException When a required value is missing + * @throws InvalidOptionException When option given doesn't exist + * @throws InvalidOptionException When a required value is missing */ private function addLongOption($name, $value) { if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); } $option = $this->definition->getOption($name); if (null === $value) { if ($option->isValueRequired()) { - throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name)); + throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); } $value = $option->isValueOptional() ? $option->getDefault() : true; @@ -177,12 +191,12 @@ private function addLongOption($name, $value) * @param string $name The argument name * @param mixed $value The value for the argument * - * @throws \InvalidArgumentException When argument given doesn't exist + * @throws InvalidArgumentException When argument given doesn't exist */ private function addArgument($name, $value) { if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } $this->arguments[$name] = $value; diff --git a/application/vendor/symfony/console/Input/Input.php b/application/vendor/symfony/console/Input/Input.php index 16f8279..817292e 100644 --- a/application/vendor/symfony/console/Input/Input.php +++ b/application/vendor/symfony/console/Input/Input.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; + /** * Input is the base class for all concrete Input classes. * @@ -24,11 +27,19 @@ */ abstract class Input implements InputInterface { + /** + * @var InputDefinition + */ protected $definition; protected $options = array(); protected $arguments = array(); protected $interactive = true; + /** + * Constructor. + * + * @param InputDefinition|null $definition A InputDefinition instance + */ public function __construct(InputDefinition $definition = null) { if (null === $definition) { @@ -69,7 +80,7 @@ public function validate() }); if (count($missingArguments) > 0) { - throw new \RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); + throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); } } @@ -103,7 +114,7 @@ public function getArguments() public function getArgument($name) { if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault(); @@ -115,7 +126,7 @@ public function getArgument($name) public function setArgument($name, $value) { if (!$this->definition->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } $this->arguments[$name] = $value; @@ -143,7 +154,7 @@ public function getOptions() public function getOption($name) { if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); } return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); @@ -155,7 +166,7 @@ public function getOption($name) public function setOption($name, $value) { if (!$this->definition->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); } $this->options[$name] = $value; diff --git a/application/vendor/symfony/console/Input/InputArgument.php b/application/vendor/symfony/console/Input/InputArgument.php index 29b8001..048ee4f 100644 --- a/application/vendor/symfony/console/Input/InputArgument.php +++ b/application/vendor/symfony/console/Input/InputArgument.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + /** * Represents a command line argument. * @@ -28,19 +31,21 @@ class InputArgument private $description; /** + * Constructor. + * * @param string $name The argument name * @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL * @param string $description A description text * @param mixed $default The default value (for self::OPTIONAL mode only) * - * @throws \InvalidArgumentException When argument mode is not valid + * @throws InvalidArgumentException When argument mode is not valid */ public function __construct($name, $mode = null, $description = '', $default = null) { if (null === $mode) { $mode = self::OPTIONAL; } elseif (!is_int($mode) || $mode > 7 || $mode < 1) { - throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); + throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); } $this->name = $name; @@ -85,19 +90,19 @@ public function isArray() * * @param mixed $default The default value * - * @throws \LogicException When incorrect default value is given + * @throws LogicException When incorrect default value is given */ public function setDefault($default = null) { if (self::REQUIRED === $this->mode && null !== $default) { - throw new \LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); + throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); } if ($this->isArray()) { if (null === $default) { $default = array(); } elseif (!is_array($default)) { - throw new \LogicException('A default value for an array argument must be an array.'); + throw new LogicException('A default value for an array argument must be an array.'); } } diff --git a/application/vendor/symfony/console/Input/InputDefinition.php b/application/vendor/symfony/console/Input/InputDefinition.php index 5e5a3ad..e9944db 100644 --- a/application/vendor/symfony/console/Input/InputDefinition.php +++ b/application/vendor/symfony/console/Input/InputDefinition.php @@ -11,9 +11,8 @@ namespace Symfony\Component\Console\Input; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Output\BufferedOutput; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; /** * A InputDefinition represents a set of valid command line arguments and options. @@ -37,6 +36,8 @@ class InputDefinition private $shortcuts; /** + * Constructor. + * * @param array $definition An array of InputArgument and InputOption instance */ public function __construct(array $definition = array()) @@ -46,6 +47,8 @@ public function __construct(array $definition = array()) /** * Sets the definition of the input. + * + * @param array $definition The definition array */ public function setDefinition(array $definition) { @@ -92,20 +95,24 @@ public function addArguments($arguments = array()) } /** - * @throws \LogicException When incorrect argument is given + * Adds an InputArgument object. + * + * @param InputArgument $argument An InputArgument object + * + * @throws LogicException When incorrect argument is given */ public function addArgument(InputArgument $argument) { if (isset($this->arguments[$argument->getName()])) { - throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); + throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); } if ($this->hasAnArrayArgument) { - throw new \LogicException('Cannot add an argument after an array argument.'); + throw new LogicException('Cannot add an argument after an array argument.'); } if ($argument->isRequired() && $this->hasOptional) { - throw new \LogicException('Cannot add a required argument after an optional one.'); + throw new LogicException('Cannot add a required argument after an optional one.'); } if ($argument->isArray()) { @@ -128,12 +135,12 @@ public function addArgument(InputArgument $argument) * * @return InputArgument An InputArgument object * - * @throws \InvalidArgumentException When argument given doesn't exist + * @throws InvalidArgumentException When argument given doesn't exist */ public function getArgument($name) { if (!$this->hasArgument($name)) { - throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; @@ -225,18 +232,22 @@ public function addOptions($options = array()) } /** - * @throws \LogicException When option given already exist + * Adds an InputOption object. + * + * @param InputOption $option An InputOption object + * + * @throws LogicException When option given already exist */ public function addOption(InputOption $option) { if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new \LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); } if ($option->getShortcut()) { foreach (explode('|', $option->getShortcut()) as $shortcut) { if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new \LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); + throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); } } } @@ -256,12 +267,12 @@ public function addOption(InputOption $option) * * @return InputOption A InputOption object * - * @throws \InvalidArgumentException When option given doesn't exist + * @throws InvalidArgumentException When option given doesn't exist */ public function getOption($name) { if (!$this->hasOption($name)) { - throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); } return $this->options[$name]; @@ -270,9 +281,6 @@ public function getOption($name) /** * Returns true if an InputOption object exists by name. * - * This method can't be used to check if the user included the option when - * executing the command (use getOption() instead). - * * @param string $name The InputOption name * * @return bool true if the InputOption object exists, false otherwise @@ -307,7 +315,7 @@ public function hasShortcut($name) /** * Gets an InputOption by shortcut. * - * @param string $shortcut The Shortcut name + * @param string $shortcut the Shortcut name * * @return InputOption An InputOption object */ @@ -338,12 +346,12 @@ public function getOptionDefaults() * * @return string The InputOption name * - * @throws \InvalidArgumentException When option given does not exist + * @throws InvalidArgumentException When option given does not exist */ private function shortcutToName($shortcut) { if (!isset($this->shortcuts[$shortcut])) { - throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); } return $this->shortcuts[$shortcut]; @@ -400,47 +408,4 @@ public function getSynopsis($short = false) return implode(' ', $elements); } - - /** - * Returns a textual representation of the InputDefinition. - * - * @return string A string representing the InputDefinition - * - * @deprecated since version 2.3, to be removed in 3.0. - */ - public function asText() - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); - - $descriptor = new TextDescriptor(); - $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); - $descriptor->describe($output, $this, array('raw_output' => true)); - - return $output->fetch(); - } - - /** - * Returns an XML representation of the InputDefinition. - * - * @param bool $asDom Whether to return a DOM or an XML string - * - * @return string|\DOMDocument An XML string representing the InputDefinition - * - * @deprecated since version 2.3, to be removed in 3.0. - */ - public function asXml($asDom = false) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); - - $descriptor = new XmlDescriptor(); - - if ($asDom) { - return $descriptor->getInputDefinitionDocument($this); - } - - $output = new BufferedOutput(); - $descriptor->describe($output, $this); - - return $output->fetch(); - } } diff --git a/application/vendor/symfony/console/Input/InputInterface.php b/application/vendor/symfony/console/Input/InputInterface.php index ac14de7..bc66466 100644 --- a/application/vendor/symfony/console/Input/InputInterface.php +++ b/application/vendor/symfony/console/Input/InputInterface.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; + /** * InputInterface is the interface implemented by all input classes. * @@ -21,7 +24,7 @@ interface InputInterface /** * Returns the first argument from the raw parameters (not parsed). * - * @return string|null The value of the first argument or null otherwise + * @return string The value of the first argument or null otherwise */ public function getFirstArgument(); @@ -30,39 +33,39 @@ public function getFirstArgument(); * * This method is to be used to introspect the input parameters * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. * - * @param string|array $values The values to look for in the raw parameters (can be an array) + * @param string|array $values The values to look for in the raw parameters (can be an array) + * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal * * @return bool true if the value is contained in the raw parameters */ - public function hasParameterOption($values); + public function hasParameterOption($values, $onlyParams = false); /** * Returns the value of a raw option (not parsed). * * This method is to be used to introspect the input parameters * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param mixed $default The default value to return if no result is found + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param mixed $default The default value to return if no result is found + * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal * * @return mixed The option value */ - public function getParameterOption($values, $default = false); + public function getParameterOption($values, $default = false, $onlyParams = false); /** * Binds the current Input instance with the given arguments and options. + * + * @param InputDefinition $definition A InputDefinition instance */ public function bind(InputDefinition $definition); /** * Validates the input. * - * @throws \RuntimeException When not enough arguments are given + * @throws RuntimeException When not enough arguments are given */ public function validate(); @@ -80,7 +83,7 @@ public function getArguments(); * * @return mixed The argument value * - * @throws \InvalidArgumentException When argument given doesn't exist + * @throws InvalidArgumentException When argument given doesn't exist */ public function getArgument($name); @@ -90,7 +93,7 @@ public function getArgument($name); * @param string $name The argument name * @param string $value The argument value * - * @throws \InvalidArgumentException When argument given doesn't exist + * @throws InvalidArgumentException When argument given doesn't exist */ public function setArgument($name, $value); @@ -117,7 +120,7 @@ public function getOptions(); * * @return mixed The option value * - * @throws \InvalidArgumentException When option given doesn't exist + * @throws InvalidArgumentException When option given doesn't exist */ public function getOption($name); @@ -127,7 +130,7 @@ public function getOption($name); * @param string $name The option name * @param string|bool $value The option value * - * @throws \InvalidArgumentException When option given doesn't exist + * @throws InvalidArgumentException When option given doesn't exist */ public function setOption($name, $value); diff --git a/application/vendor/symfony/console/Input/InputOption.php b/application/vendor/symfony/console/Input/InputOption.php index c2b57c7..f08c5f2 100644 --- a/application/vendor/symfony/console/Input/InputOption.php +++ b/application/vendor/symfony/console/Input/InputOption.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + /** * Represents a command line option. * @@ -30,13 +33,15 @@ class InputOption private $description; /** + * Constructor. + * * @param string $name The option name * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts * @param int $mode The option mode: One of the VALUE_* constants * @param string $description A description text * @param mixed $default The default value (must be null for self::VALUE_NONE) * - * @throws \InvalidArgumentException If option mode is invalid or incompatible + * @throws InvalidArgumentException If option mode is invalid or incompatible */ public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null) { @@ -45,7 +50,7 @@ public function __construct($name, $shortcut = null, $mode = null, $description } if (empty($name)) { - throw new \InvalidArgumentException('An option name cannot be empty.'); + throw new InvalidArgumentException('An option name cannot be empty.'); } if (empty($shortcut)) { @@ -61,14 +66,14 @@ public function __construct($name, $shortcut = null, $mode = null, $description $shortcut = implode('|', $shortcuts); if (empty($shortcut)) { - throw new \InvalidArgumentException('An option shortcut cannot be empty.'); + throw new InvalidArgumentException('An option shortcut cannot be empty.'); } } if (null === $mode) { $mode = self::VALUE_NONE; } elseif (!is_int($mode) || $mode > 15 || $mode < 1) { - throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); + throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); } $this->name = $name; @@ -77,7 +82,7 @@ public function __construct($name, $shortcut = null, $mode = null, $description $this->description = $description; if ($this->isArray() && !$this->acceptValue()) { - throw new \InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); + throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); } $this->setDefault($default); @@ -148,19 +153,19 @@ public function isArray() * * @param mixed $default The default value * - * @throws \LogicException When incorrect default value is given + * @throws LogicException When incorrect default value is given */ public function setDefault($default = null) { if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new \LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); + throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); } if ($this->isArray()) { if (null === $default) { $default = array(); } elseif (!is_array($default)) { - throw new \LogicException('A default value for an array option must be an array.'); + throw new LogicException('A default value for an array option must be an array.'); } } @@ -190,9 +195,11 @@ public function getDescription() /** * Checks whether the given option equals this one. * + * @param InputOption $option option to compare + * * @return bool */ - public function equals(self $option) + public function equals(InputOption $option) { return $option->getName() === $this->getName() && $option->getShortcut() === $this->getShortcut() diff --git a/application/vendor/symfony/console/Input/StringInput.php b/application/vendor/symfony/console/Input/StringInput.php index 754d712..9ce0217 100644 --- a/application/vendor/symfony/console/Input/StringInput.php +++ b/application/vendor/symfony/console/Input/StringInput.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Input; +use Symfony\Component\Console\Exception\InvalidArgumentException; + /** * StringInput represents an input provided as a string. * @@ -26,24 +28,15 @@ class StringInput extends ArgvInput const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'; /** - * @param string $input A string representing the parameters from the CLI - * @param InputDefinition $definition A InputDefinition instance + * Constructor. * - * @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead + * @param string $input An array of parameters from the CLI (in the argv format) */ - public function __construct($input, InputDefinition $definition = null) + public function __construct($input) { - if ($definition) { - @trigger_error('The $definition argument of the '.__METHOD__.' method is deprecated and will be removed in 3.0. Set this parameter with the bind() method instead.', E_USER_DEPRECATED); - } - - parent::__construct(array(), null); + parent::__construct(array()); $this->setTokens($this->tokenize($input)); - - if (null !== $definition) { - $this->bind($definition); - } } /** @@ -53,7 +46,7 @@ public function __construct($input, InputDefinition $definition = null) * * @return array An array of tokens * - * @throws \InvalidArgumentException When unable to parse input (should never happen) + * @throws InvalidArgumentException When unable to parse input (should never happen) */ private function tokenize($input) { @@ -70,7 +63,7 @@ private function tokenize($input) $tokens[] = stripcslashes($match[1]); } else { // should never happen - throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); + throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); } $cursor += strlen($match[0]); diff --git a/application/vendor/symfony/console/LICENSE b/application/vendor/symfony/console/LICENSE index 21d7fb9..12a7453 100644 --- a/application/vendor/symfony/console/LICENSE +++ b/application/vendor/symfony/console/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2016 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/application/vendor/symfony/console/Logger/ConsoleLogger.php b/application/vendor/symfony/console/Logger/ConsoleLogger.php index d1aba10..1f7417e 100644 --- a/application/vendor/symfony/console/Logger/ConsoleLogger.php +++ b/application/vendor/symfony/console/Logger/ConsoleLogger.php @@ -22,14 +22,20 @@ * * @author Kévin Dunglas * - * @see http://www.php-fig.org/psr/psr-3/ + * @link http://www.php-fig.org/psr/psr-3/ */ class ConsoleLogger extends AbstractLogger { const INFO = 'info'; const ERROR = 'error'; + /** + * @var OutputInterface + */ private $output; + /** + * @var array + */ private $verbosityLevelMap = array( LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, @@ -40,6 +46,9 @@ class ConsoleLogger extends AbstractLogger LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, ); + /** + * @var array + */ private $formatLevelMap = array( LogLevel::EMERGENCY => self::ERROR, LogLevel::ALERT => self::ERROR, @@ -51,6 +60,11 @@ class ConsoleLogger extends AbstractLogger LogLevel::DEBUG => self::INFO, ); + /** + * @param OutputInterface $output + * @param array $verbosityLevelMap + * @param array $formatLevelMap + */ public function __construct(OutputInterface $output, array $verbosityLevelMap = array(), array $formatLevelMap = array()) { $this->output = $output; @@ -68,7 +82,7 @@ public function log($level, $message, array $context = array()) } // Write to the error output if necessary and available - if (self::ERROR === $this->formatLevelMap[$level] && $this->output instanceof ConsoleOutputInterface) { + if ($this->formatLevelMap[$level] === self::ERROR && $this->output instanceof ConsoleOutputInterface) { $output = $this->output->getErrorOutput(); } else { $output = $this->output; diff --git a/application/vendor/symfony/console/Output/BufferedOutput.php b/application/vendor/symfony/console/Output/BufferedOutput.php index 8afc893..5682fc2 100644 --- a/application/vendor/symfony/console/Output/BufferedOutput.php +++ b/application/vendor/symfony/console/Output/BufferedOutput.php @@ -16,6 +16,9 @@ */ class BufferedOutput extends Output { + /** + * @var string + */ private $buffer = ''; /** @@ -39,7 +42,7 @@ protected function doWrite($message, $newline) $this->buffer .= $message; if ($newline) { - $this->buffer .= PHP_EOL; + $this->buffer .= "\n"; } } } diff --git a/application/vendor/symfony/console/Output/ConsoleOutput.php b/application/vendor/symfony/console/Output/ConsoleOutput.php index 84efb98..f666c79 100644 --- a/application/vendor/symfony/console/Output/ConsoleOutput.php +++ b/application/vendor/symfony/console/Output/ConsoleOutput.php @@ -28,9 +28,14 @@ */ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { + /** + * @var StreamOutput + */ private $stderr; /** + * Constructor. + * * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) diff --git a/application/vendor/symfony/console/Output/ConsoleOutputInterface.php b/application/vendor/symfony/console/Output/ConsoleOutputInterface.php index b44ea7e..5eb4fc7 100644 --- a/application/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/application/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -26,5 +26,10 @@ interface ConsoleOutputInterface extends OutputInterface */ public function getErrorOutput(); + /** + * Sets the OutputInterface used for errors. + * + * @param OutputInterface $error + */ public function setErrorOutput(OutputInterface $error); } diff --git a/application/vendor/symfony/console/Output/NullOutput.php b/application/vendor/symfony/console/Output/NullOutput.php index bd3b7e6..218f285 100644 --- a/application/vendor/symfony/console/Output/NullOutput.php +++ b/application/vendor/symfony/console/Output/NullOutput.php @@ -108,7 +108,7 @@ public function isDebug() /** * {@inheritdoc} */ - public function writeln($messages, $type = self::OUTPUT_NORMAL) + public function writeln($messages, $options = self::OUTPUT_NORMAL) { // do nothing } @@ -116,7 +116,7 @@ public function writeln($messages, $type = self::OUTPUT_NORMAL) /** * {@inheritdoc} */ - public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) + public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) { // do nothing } diff --git a/application/vendor/symfony/console/Output/Output.php b/application/vendor/symfony/console/Output/Output.php index e7e165e..c12015c 100644 --- a/application/vendor/symfony/console/Output/Output.php +++ b/application/vendor/symfony/console/Output/Output.php @@ -33,6 +33,8 @@ abstract class Output implements OutputInterface private $formatter; /** + * Constructor. + * * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool $decorated Whether to decorate messages * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) @@ -127,22 +129,28 @@ public function isDebug() /** * {@inheritdoc} */ - public function writeln($messages, $type = self::OUTPUT_NORMAL) + public function writeln($messages, $options = self::OUTPUT_NORMAL) { - $this->write($messages, true, $type); + $this->write($messages, true, $options); } /** * {@inheritdoc} */ - public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) + public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL) { - if (self::VERBOSITY_QUIET === $this->verbosity) { + $messages = (array) $messages; + + $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; + $type = $types & $options ?: self::OUTPUT_NORMAL; + + $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; + $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; + + if ($verbosity > $this->getVerbosity()) { return; } - $messages = (array) $messages; - foreach ($messages as $message) { switch ($type) { case OutputInterface::OUTPUT_NORMAL: @@ -153,8 +161,6 @@ public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL) case OutputInterface::OUTPUT_PLAIN: $message = strip_tags($this->formatter->format($message)); break; - default: - throw new \InvalidArgumentException(sprintf('Unknown output type given (%s)', $type)); } $this->doWrite($message, $newline); diff --git a/application/vendor/symfony/console/Output/OutputInterface.php b/application/vendor/symfony/console/Output/OutputInterface.php index ff007e6..a291ca7 100644 --- a/application/vendor/symfony/console/Output/OutputInterface.php +++ b/application/vendor/symfony/console/Output/OutputInterface.php @@ -20,36 +20,32 @@ */ interface OutputInterface { - const VERBOSITY_QUIET = 0; - const VERBOSITY_NORMAL = 1; - const VERBOSITY_VERBOSE = 2; - const VERBOSITY_VERY_VERBOSE = 3; - const VERBOSITY_DEBUG = 4; + const VERBOSITY_QUIET = 16; + const VERBOSITY_NORMAL = 32; + const VERBOSITY_VERBOSE = 64; + const VERBOSITY_VERY_VERBOSE = 128; + const VERBOSITY_DEBUG = 256; - const OUTPUT_NORMAL = 0; - const OUTPUT_RAW = 1; - const OUTPUT_PLAIN = 2; + const OUTPUT_NORMAL = 1; + const OUTPUT_RAW = 2; + const OUTPUT_PLAIN = 4; /** * Writes a message to the output. * * @param string|array $messages The message as an array of lines or a single string * @param bool $newline Whether to add a newline - * @param int $type The type of output (one of the OUTPUT constants) - * - * @throws \InvalidArgumentException When unknown output type is given + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL); + public function write($messages, $newline = false, $options = 0); /** * Writes a message to the output and adds a newline at the end. * - * @param string|array $messages The message as an array of lines or a single string - * @param int $type The type of output (one of the OUTPUT constants) - * - * @throws \InvalidArgumentException When unknown output type is given + * @param string|array $messages The message as an array of lines of a single string + * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL */ - public function writeln($messages, $type = self::OUTPUT_NORMAL); + public function writeln($messages, $options = 0); /** * Sets the verbosity of the output. @@ -65,6 +61,34 @@ public function setVerbosity($level); */ public function getVerbosity(); + /** + * Returns whether verbosity is quiet (-q). + * + * @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise + */ + public function isQuiet(); + + /** + * Returns whether verbosity is verbose (-v). + * + * @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise + */ + public function isVerbose(); + + /** + * Returns whether verbosity is very verbose (-vv). + * + * @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise + */ + public function isVeryVerbose(); + + /** + * Returns whether verbosity is debug (-vvv). + * + * @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise + */ + public function isDebug(); + /** * Sets the decorated flag. * @@ -79,6 +103,11 @@ public function setDecorated($decorated); */ public function isDecorated(); + /** + * Sets output formatter. + * + * @param OutputFormatterInterface $formatter + */ public function setFormatter(OutputFormatterInterface $formatter); /** diff --git a/application/vendor/symfony/console/Output/StreamOutput.php b/application/vendor/symfony/console/Output/StreamOutput.php index b0897b2..9e6b748 100644 --- a/application/vendor/symfony/console/Output/StreamOutput.php +++ b/application/vendor/symfony/console/Output/StreamOutput.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Output; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Formatter\OutputFormatterInterface; /** @@ -31,17 +33,19 @@ class StreamOutput extends Output private $stream; /** + * Constructor. + * * @param resource $stream A stream resource * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) * - * @throws \InvalidArgumentException When first argument is not a real stream + * @throws InvalidArgumentException When first argument is not a real stream */ public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null) { if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); + throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); } $this->stream = $stream; @@ -70,7 +74,7 @@ protected function doWrite($message, $newline) { if (false === @fwrite($this->stream, $message) || ($newline && (false === @fwrite($this->stream, PHP_EOL)))) { // should never happen - throw new \RuntimeException('Unable to write output.'); + throw new RuntimeException('Unable to write output.'); } fflush($this->stream); @@ -81,34 +85,21 @@ protected function doWrite($message, $newline) * * Colorization is disabled if not supported by the stream: * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler + * - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty + * - non tty consoles * * @return bool true if the stream supports colorization, false otherwise */ protected function hasColorSupport() { if (DIRECTORY_SEPARATOR === '\\') { - return (function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($this->stream)) + return + 0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD) || false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM'); } - if (function_exists('stream_isatty')) { - return @stream_isatty($this->stream); - } - - if (function_exists('posix_isatty')) { - return @posix_isatty($this->stream); - } - - $stat = @fstat($this->stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; + return function_exists('posix_isatty') && @posix_isatty($this->stream); } } diff --git a/application/vendor/symfony/console/Question/ChoiceQuestion.php b/application/vendor/symfony/console/Question/ChoiceQuestion.php index 7417f67..39c4a85 100644 --- a/application/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/application/vendor/symfony/console/Question/ChoiceQuestion.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Console\Question; +use Symfony\Component\Console\Exception\InvalidArgumentException; + /** * Represents a choice question. * @@ -24,16 +26,14 @@ class ChoiceQuestion extends Question private $errorMessage = 'Value "%s" is invalid'; /** + * Constructor. + * * @param string $question The question to ask to the user * @param array $choices The list of available choices * @param mixed $default The default answer to return */ public function __construct($question, array $choices, $default = null) { - if (!$choices) { - throw new \LogicException('Choice question must have at least 1 choice available.'); - } - parent::__construct($question, $default); $this->choices = $choices; @@ -58,7 +58,7 @@ public function getChoices() * * @param bool $multiselect * - * @return $this + * @return ChoiceQuestion The current instance */ public function setMultiselect($multiselect) { @@ -93,7 +93,7 @@ public function getPrompt() * * @param string $prompt * - * @return $this + * @return ChoiceQuestion The current instance */ public function setPrompt($prompt) { @@ -109,7 +109,7 @@ public function setPrompt($prompt) * * @param string $errorMessage * - * @return $this + * @return ChoiceQuestion The current instance */ public function setErrorMessage($errorMessage) { @@ -137,8 +137,8 @@ private function getDefaultValidator() if ($multiselect) { // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', $selectedChoices, $matches)) { - throw new \InvalidArgumentException(sprintf($errorMessage, $selected)); + if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { + throw new InvalidArgumentException(sprintf($errorMessage, $selected)); } $selectedChoices = explode(',', $selectedChoices); } else { @@ -155,7 +155,7 @@ private function getDefaultValidator() } if (count($results) > 1) { - throw new \InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results))); + throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results))); } $result = array_search($value, $choices); @@ -171,7 +171,7 @@ private function getDefaultValidator() } if (false === $result) { - throw new \InvalidArgumentException(sprintf($errorMessage, $value)); + throw new InvalidArgumentException(sprintf($errorMessage, $value)); } $multiselectChoices[] = (string) $result; diff --git a/application/vendor/symfony/console/Question/ConfirmationQuestion.php b/application/vendor/symfony/console/Question/ConfirmationQuestion.php index 40f54b4..29d9887 100644 --- a/application/vendor/symfony/console/Question/ConfirmationQuestion.php +++ b/application/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -21,6 +21,8 @@ class ConfirmationQuestion extends Question private $trueAnswerRegex; /** + * Constructor. + * * @param string $question The question to ask to the user * @param bool $default The default answer to return, true or false * @param string $trueAnswerRegex A regex to match the "yes" answer diff --git a/application/vendor/symfony/console/Question/Question.php b/application/vendor/symfony/console/Question/Question.php index d94836b..7a69279 100644 --- a/application/vendor/symfony/console/Question/Question.php +++ b/application/vendor/symfony/console/Question/Question.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Console\Question; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Exception\LogicException; + /** * Represents a Question. * @@ -28,6 +31,8 @@ class Question private $normalizer; /** + * Constructor. + * * @param string $question The question to ask to the user * @param mixed $default The default answer to return if the user enters nothing */ @@ -72,14 +77,14 @@ public function isHidden() * * @param bool $hidden * - * @return $this + * @return Question The current instance * - * @throws \LogicException In case the autocompleter is also used + * @throws LogicException In case the autocompleter is also used */ public function setHidden($hidden) { if ($this->autocompleterValues) { - throw new \LogicException('A hidden question cannot use the autocompleter.'); + throw new LogicException('A hidden question cannot use the autocompleter.'); } $this->hidden = (bool) $hidden; @@ -102,7 +107,7 @@ public function isHiddenFallback() * * @param bool $fallback * - * @return $this + * @return Question The current instance */ public function setHiddenFallback($fallback) { @@ -114,7 +119,7 @@ public function setHiddenFallback($fallback) /** * Gets values for the autocompleter. * - * @return null|iterable + * @return null|array|\Traversable */ public function getAutocompleterValues() { @@ -124,12 +129,12 @@ public function getAutocompleterValues() /** * Sets values for the autocompleter. * - * @param null|iterable $values + * @param null|array|\Traversable $values * - * @return $this + * @return Question The current instance * - * @throws \InvalidArgumentException - * @throws \LogicException + * @throws InvalidArgumentException + * @throws LogicException */ public function setAutocompleterValues($values) { @@ -137,12 +142,14 @@ public function setAutocompleterValues($values) $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); } - if (null !== $values && !is_array($values) && !$values instanceof \Traversable) { - throw new \InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.'); + if (null !== $values && !is_array($values)) { + if (!$values instanceof \Traversable || !$values instanceof \Countable) { + throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.'); + } } if ($this->hidden) { - throw new \LogicException('A hidden question cannot use the autocompleter.'); + throw new LogicException('A hidden question cannot use the autocompleter.'); } $this->autocompleterValues = $values; @@ -155,9 +162,9 @@ public function setAutocompleterValues($values) * * @param null|callable $validator * - * @return $this + * @return Question The current instance */ - public function setValidator($validator) + public function setValidator(callable $validator = null) { $this->validator = $validator; @@ -181,14 +188,14 @@ public function getValidator() * * @param null|int $attempts * - * @return $this + * @return Question The current instance * - * @throws \InvalidArgumentException in case the number of attempts is invalid + * @throws InvalidArgumentException In case the number of attempts is invalid. */ public function setMaxAttempts($attempts) { if (null !== $attempts && $attempts < 1) { - throw new \InvalidArgumentException('Maximum number of attempts must be a positive value.'); + throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); } $this->attempts = $attempts; @@ -215,9 +222,9 @@ public function getMaxAttempts() * * @param callable $normalizer * - * @return $this + * @return Question The current instance */ - public function setNormalizer($normalizer) + public function setNormalizer(callable $normalizer) { $this->normalizer = $normalizer; diff --git a/application/vendor/symfony/console/Shell.php b/application/vendor/symfony/console/Shell.php deleted file mode 100644 index b2e234c..0000000 --- a/application/vendor/symfony/console/Shell.php +++ /dev/null @@ -1,224 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Process\ProcessBuilder; -use Symfony\Component\Process\PhpExecutableFinder; - -/** - * A Shell wraps an Application to add shell capabilities to it. - * - * Support for history and completion only works with a PHP compiled - * with readline support (either --with-readline or --with-libedit) - * - * @author Fabien Potencier - * @author Martin Hasoň - */ -class Shell -{ - private $application; - private $history; - private $output; - private $hasReadline; - private $processIsolation = false; - - /** - * If there is no readline support for the current PHP executable - * a \RuntimeException exception is thrown. - */ - public function __construct(Application $application) - { - $this->hasReadline = function_exists('readline'); - $this->application = $application; - $this->history = getenv('HOME').'/.history_'.$application->getName(); - $this->output = new ConsoleOutput(); - } - - /** - * Runs the shell. - */ - public function run() - { - $this->application->setAutoExit(false); - $this->application->setCatchExceptions(true); - - if ($this->hasReadline) { - readline_read_history($this->history); - readline_completion_function(array($this, 'autocompleter')); - } - - $this->output->writeln($this->getHeader()); - $php = null; - if ($this->processIsolation) { - $finder = new PhpExecutableFinder(); - $php = $finder->find(); - $this->output->writeln(<<<'EOF' -Running with process isolation, you should consider this: - * each command is executed as separate process, - * commands don't support interactivity, all params must be passed explicitly, - * commands output is not colorized. - -EOF - ); - } - - while (true) { - $command = $this->readline(); - - if (false === $command) { - $this->output->writeln("\n"); - - break; - } - - if ($this->hasReadline) { - readline_add_history($command); - readline_write_history($this->history); - } - - if ($this->processIsolation) { - $pb = new ProcessBuilder(); - - $process = $pb - ->add($php) - ->add($_SERVER['argv'][0]) - ->add($command) - ->inheritEnvironmentVariables(true) - ->getProcess() - ; - - $output = $this->output; - $process->run(function ($type, $data) use ($output) { - $output->writeln($data); - }); - - $ret = $process->getExitCode(); - } else { - $ret = $this->application->run(new StringInput($command), $this->output); - } - - if (0 !== $ret) { - $this->output->writeln(sprintf('The command terminated with an error status (%s)', $ret)); - } - } - } - - /** - * Returns the shell header. - * - * @return string The header string - */ - protected function getHeader() - { - return <<{$this->application->getName()} shell ({$this->application->getVersion()}). - -At the prompt, type help for some help, -or list to get a list of available commands. - -To exit the shell, type ^D. - -EOF; - } - - /** - * Renders a prompt. - * - * @return string The prompt - */ - protected function getPrompt() - { - // using the formatter here is required when using readline - return $this->output->getFormatter()->format($this->application->getName().' > '); - } - - protected function getOutput() - { - return $this->output; - } - - protected function getApplication() - { - return $this->application; - } - - /** - * Tries to return autocompletion for the current entered text. - * - * @param string $text The last segment of the entered text - * - * @return bool|array A list of guessed strings or true - */ - private function autocompleter($text) - { - $info = readline_info(); - $text = substr($info['line_buffer'], 0, $info['end']); - - if ($info['point'] !== $info['end']) { - return true; - } - - // task name? - if (false === strpos($text, ' ') || !$text) { - return array_keys($this->application->all()); - } - - // options and arguments? - try { - $command = $this->application->find(substr($text, 0, strpos($text, ' '))); - } catch (\Exception $e) { - return true; - } - - $list = array('--help'); - foreach ($command->getDefinition()->getOptions() as $option) { - $list[] = '--'.$option->getName(); - } - - return $list; - } - - /** - * Reads a single line from standard input. - * - * @return string The single line from standard input - */ - private function readline() - { - if ($this->hasReadline) { - $line = readline($this->getPrompt()); - } else { - $this->output->write($this->getPrompt()); - $line = fgets(STDIN, 1024); - $line = (false === $line || '' === $line) ? false : rtrim($line); - } - - return $line; - } - - public function getProcessIsolation() - { - return $this->processIsolation; - } - - public function setProcessIsolation($processIsolation) - { - $this->processIsolation = (bool) $processIsolation; - - if ($this->processIsolation && !class_exists('Symfony\\Component\\Process\\Process')) { - throw new \RuntimeException('Unable to isolate processes as the Symfony Process Component is not installed.'); - } - } -} diff --git a/application/vendor/symfony/console/Style/OutputStyle.php b/application/vendor/symfony/console/Style/OutputStyle.php index f3bf291..de7be1e 100644 --- a/application/vendor/symfony/console/Style/OutputStyle.php +++ b/application/vendor/symfony/console/Style/OutputStyle.php @@ -24,6 +24,9 @@ abstract class OutputStyle implements OutputInterface, StyleInterface { private $output; + /** + * @param OutputInterface $output + */ public function __construct(OutputInterface $output) { $this->output = $output; @@ -110,4 +113,36 @@ public function getFormatter() { return $this->output->getFormatter(); } + + /** + * {@inheritdoc} + */ + public function isQuiet() + { + return $this->output->isQuiet(); + } + + /** + * {@inheritdoc} + */ + public function isVerbose() + { + return $this->output->isVerbose(); + } + + /** + * {@inheritdoc} + */ + public function isVeryVerbose() + { + return $this->output->isVeryVerbose(); + } + + /** + * {@inheritdoc} + */ + public function isDebug() + { + return $this->output->isDebug(); + } } diff --git a/application/vendor/symfony/console/Style/StyleInterface.php b/application/vendor/symfony/console/Style/StyleInterface.php index 475c268..2448547 100644 --- a/application/vendor/symfony/console/Style/StyleInterface.php +++ b/application/vendor/symfony/console/Style/StyleInterface.php @@ -34,6 +34,8 @@ public function section($message); /** * Formats a list. + * + * @param array $elements */ public function listing(array $elements); @@ -81,6 +83,9 @@ public function caution($message); /** * Formats a table. + * + * @param array $headers + * @param array $rows */ public function table(array $headers, array $rows); @@ -91,7 +96,7 @@ public function table(array $headers, array $rows); * @param string|null $default * @param callable|null $validator * - * @return mixed + * @return string */ public function ask($question, $default = null, $validator = null); @@ -101,7 +106,7 @@ public function ask($question, $default = null, $validator = null); * @param string $question * @param callable|null $validator * - * @return mixed + * @return string */ public function askHidden($question, $validator = null); @@ -122,7 +127,7 @@ public function confirm($question, $default = true); * @param array $choices * @param string|int|null $default * - * @return mixed + * @return string */ public function choice($question, array $choices, $default = null); diff --git a/application/vendor/symfony/console/Style/SymfonyStyle.php b/application/vendor/symfony/console/Style/SymfonyStyle.php index bf25c06..a9c5744 100644 --- a/application/vendor/symfony/console/Style/SymfonyStyle.php +++ b/application/vendor/symfony/console/Style/SymfonyStyle.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Console\Style; use Symfony\Component\Console\Application; +use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Helper\ProgressBar; @@ -39,6 +40,10 @@ class SymfonyStyle extends OutputStyle private $lineLength; private $bufferedOutput; + /** + * @param InputInterface $input + * @param OutputInterface $output + */ public function __construct(InputInterface $input, OutputInterface $output) { $this->input = $input; @@ -60,53 +65,10 @@ public function __construct(InputInterface $input, OutputInterface $output) */ public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false) { - $this->autoPrependBlock(); $messages = is_array($messages) ? array_values($messages) : array($messages); - $indentLength = 0; - $lines = array(); - if (null !== $type) { - $typePrefix = sprintf('[%s] ', $type); - $indentLength = strlen($typePrefix); - $lineIndentation = str_repeat(' ', $indentLength); - } - - // wrap and add newlines for each element - foreach ($messages as $key => $message) { - $message = OutputFormatter::escape($message); - $lines = array_merge($lines, explode(PHP_EOL, wordwrap($message, $this->lineLength - Helper::strlen($prefix) - $indentLength, PHP_EOL, true))); - - // prefix each line with a number of spaces equivalent to the type length - if (null !== $type) { - foreach ($lines as &$line) { - $line = $lineIndentation === substr($line, 0, $indentLength) ? $line : $lineIndentation.$line; - } - } - - if (count($messages) > 1 && $key < count($messages) - 1) { - $lines[] = ''; - } - } - - if (null !== $type) { - $lines[0] = substr_replace($lines[0], $typePrefix, 0, $indentLength); - } - - if ($padding && $this->isDecorated()) { - array_unshift($lines, ''); - $lines[] = ''; - } - - foreach ($lines as &$line) { - $line = sprintf('%s%s', $prefix, $line); - $line .= str_repeat(' ', $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line)); - - if ($style) { - $line = sprintf('<%s>%s', $style, $line); - } - } - - $this->writeln($lines); + $this->autoPrependBlock(); + $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, true)); $this->newLine(); } @@ -117,8 +79,8 @@ public function title($message) { $this->autoPrependBlock(); $this->writeln(array( - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', strlen($message))), + sprintf('%s', $message), + sprintf('%s', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), )); $this->newLine(); } @@ -130,8 +92,8 @@ public function section($message) { $this->autoPrependBlock(); $this->writeln(array( - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', strlen($message))), + sprintf('%s', $message), + sprintf('%s', str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message))), )); $this->newLine(); } @@ -157,15 +119,24 @@ public function text($message) { $this->autoPrependText(); - if (!is_array($message)) { - $this->writeln(sprintf(' // %s', $message)); - - return; + $messages = is_array($message) ? array_values($message) : array($message); + foreach ($messages as $message) { + $this->writeln(sprintf(' %s', $message)); } + } - foreach ($message as $element) { - $this->text($element); - } + /** + * Formats a command comment. + * + * @param string|array $message + */ + public function comment($message) + { + $messages = is_array($message) ? array_values($message) : array($message); + + $this->autoPrependBlock(); + $this->writeln($this->createBlock($messages, null, null, ' // ')); + $this->newLine(); } /** @@ -314,7 +285,9 @@ public function createProgressBar($max = 0) } /** - * @return mixed + * @param Question $question + * + * @return string */ public function askQuestion(Question $question) { @@ -369,7 +342,7 @@ public function newLine($count = 1) private function getProgressBar() { if (!$this->progressBar) { - throw new \RuntimeException('The ProgressBar is not started.'); + throw new RuntimeException('The ProgressBar is not started.'); } return $this->progressBar; @@ -411,4 +384,52 @@ private function reduceBuffer($messages) return substr($value, -4); }, array_merge(array($this->bufferedOutput->fetch()), (array) $messages)); } + + private function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false) + { + $indentLength = 0; + $prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix); + $lines = array(); + + if (null !== $type) { + $type = sprintf('[%s] ', $type); + $indentLength = strlen($type); + $lineIndentation = str_repeat(' ', $indentLength); + } + + // wrap and add newlines for each element + foreach ($messages as $key => $message) { + if ($escape) { + $message = OutputFormatter::escape($message); + } + + $lines = array_merge($lines, explode(PHP_EOL, wordwrap($message, $this->lineLength - $prefixLength - $indentLength, PHP_EOL, true))); + + if (count($messages) > 1 && $key < count($messages) - 1) { + $lines[] = ''; + } + } + + $firstLineIndex = 0; + if ($padding && $this->isDecorated()) { + $firstLineIndex = 1; + array_unshift($lines, ''); + $lines[] = ''; + } + + foreach ($lines as $i => &$line) { + if (null !== $type) { + $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; + } + + $line = $prefix.$line; + $line .= str_repeat(' ', $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line)); + + if ($style) { + $line = sprintf('<%s>%s', $style, $line); + } + } + + return $lines; + } } diff --git a/application/vendor/symfony/console/Tester/ApplicationTester.php b/application/vendor/symfony/console/Tester/ApplicationTester.php index dc12164..90efbab 100644 --- a/application/vendor/symfony/console/Tester/ApplicationTester.php +++ b/application/vendor/symfony/console/Tester/ApplicationTester.php @@ -34,6 +34,11 @@ class ApplicationTester private $output; private $statusCode; + /** + * Constructor. + * + * @param Application $application An Application instance to test + */ public function __construct(Application $application) { $this->application = $application; diff --git a/application/vendor/symfony/console/Tester/CommandTester.php b/application/vendor/symfony/console/Tester/CommandTester.php index a194949..f95298b 100644 --- a/application/vendor/symfony/console/Tester/CommandTester.php +++ b/application/vendor/symfony/console/Tester/CommandTester.php @@ -29,6 +29,11 @@ class CommandTester private $output; private $statusCode; + /** + * Constructor. + * + * @param Command $command A Command instance to test + */ public function __construct(Command $command) { $this->command = $command; @@ -65,7 +70,9 @@ public function execute(array $input, array $options = array()) } $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - $this->output->setDecorated(isset($options['decorated']) ? $options['decorated'] : false); + if (isset($options['decorated'])) { + $this->output->setDecorated($options['decorated']); + } if (isset($options['verbosity'])) { $this->output->setVerbosity($options['verbosity']); } diff --git a/application/vendor/symfony/console/Tests/ApplicationTest.php b/application/vendor/symfony/console/Tests/ApplicationTest.php index 5ab3b0a..3ca450e 100644 --- a/application/vendor/symfony/console/Tests/ApplicationTest.php +++ b/application/vendor/symfony/console/Tests/ApplicationTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console\Tests; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\FormatterHelper; @@ -31,7 +30,7 @@ use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\EventDispatcher\EventDispatcher; -class ApplicationTest extends TestCase +class ApplicationTest extends \PHPUnit_Framework_TestCase { protected static $fixturesPath; @@ -39,7 +38,6 @@ public static function setUpBeforeClass() { self::$fixturesPath = realpath(__DIR__.'/Fixtures/'); require_once self::$fixturesPath.'/FooCommand.php'; - require_once self::$fixturesPath.'/FooOptCommand.php'; require_once self::$fixturesPath.'/Foo1Command.php'; require_once self::$fixturesPath.'/Foo2Command.php'; require_once self::$fixturesPath.'/Foo3Command.php'; @@ -49,8 +47,6 @@ public static function setUpBeforeClass() require_once self::$fixturesPath.'/BarBucCommand.php'; require_once self::$fixturesPath.'/FooSubnamespaced1Command.php'; require_once self::$fixturesPath.'/FooSubnamespaced2Command.php'; - require_once self::$fixturesPath.'/TestTiti.php'; - require_once self::$fixturesPath.'/TestToto.php'; } protected function normalizeLineBreaks($text) @@ -180,7 +176,7 @@ public function testSilentHelp() } /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException * @expectedExceptionMessage The command "foofoo" does not exist. */ public function testGetInvalidCommand() @@ -216,7 +212,7 @@ public function testFindNamespaceWithSubnamespaces() } /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException * @expectedExceptionMessage The namespace "f" is ambiguous (foo, foo1). */ public function testFindAmbiguousNamespace() @@ -228,16 +224,8 @@ public function testFindAmbiguousNamespace() $application->findNamespace('f'); } - public function testFindNonAmbiguous() - { - $application = new Application(); - $application->add(new \TestTiti()); - $application->add(new \TestToto()); - $this->assertEquals('test-toto', $application->find('test')->getName()); - } - /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException * @expectedExceptionMessage There are no commands defined in the "bar" namespace. */ public function testFindInvalidNamespace() @@ -247,7 +235,7 @@ public function testFindInvalidNamespace() } /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException * @expectedExceptionMessage Command "foo1" is not defined */ public function testFindUniqueNameButNamespaceName() @@ -277,12 +265,7 @@ public function testFind() */ public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage) { - if (method_exists($this, 'expectException')) { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage($expectedExceptionMessage); - } else { - $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); - } + $this->setExpectedException('Symfony\Component\Console\Exception\CommandNotFoundException', $expectedExceptionMessage); $application = new Application(); $application->add(new \FooCommand()); @@ -330,7 +313,7 @@ public function testFindCommandWithMissingNamespace() /** * @dataProvider provideInvalidCommandNamesSingle - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException * @expectedExceptionMessage Did you mean this */ public function testFindAlternativeExceptionMessageSingle($name) @@ -358,10 +341,10 @@ public function testFindAlternativeExceptionMessageMultiple() // Command + plural try { $application->find('foo:baR'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); $this->assertRegExp('/foo1:bar/', $e->getMessage()); $this->assertRegExp('/foo:bar/', $e->getMessage()); } @@ -369,10 +352,10 @@ public function testFindAlternativeExceptionMessageMultiple() // Namespace + plural try { $application->find('foo2:bar'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); $this->assertRegExp('/foo1/', $e->getMessage()); } @@ -382,9 +365,9 @@ public function testFindAlternativeExceptionMessageMultiple() // Subnamespace + plural try { $a = $application->find('foo3:'); - $this->fail('->find() should throw an \InvalidArgumentException if a command is ambiguous because of a subnamespace, with alternatives'); + $this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e); $this->assertRegExp('/foo3:bar/', $e->getMessage()); $this->assertRegExp('/foo3:bar:toh/', $e->getMessage()); } @@ -400,23 +383,25 @@ public function testFindAlternativeCommands() try { $application->find($commandName = 'Unknown command'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without alternatives'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); + $this->assertSame(array(), $e->getAlternatives()); + $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without alternatives'); } - // Test if "bar1" command throw an "\InvalidArgumentException" and does not contain + // Test if "bar1" command throw a "CommandNotFoundException" and does not contain // "foo:bar" as alternative because "bar1" is too far from "foo:bar" try { $application->find($commandName = 'bar1'); - $this->fail('->find() throws an \InvalidArgumentException if command does not exist'); + $this->fail('->find() throws a CommandNotFoundException if command does not exist'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist'); - $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives'); - $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "afoobar1"'); - $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar1"'); - $this->assertNotRegExp('/foo:bar(?>!1)/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without "foo:bar" alternative'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist'); + $this->assertSame(array('afoobar1', 'foo:bar1'), $e->getAlternatives()); + $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives'); + $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"'); + $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"'); + $this->assertNotRegExp('/foo:bar(?>!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative'); } } @@ -444,27 +429,32 @@ public function testFindAlternativeNamespace() try { $application->find('Unknown-namespace:Unknown-command'); - $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist'); + $this->fail('->find() throws a CommandNotFoundException if namespace does not exist'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist'); - $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist'); + $this->assertSame(array(), $e->getAlternatives()); + $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, without alternatives'); } try { $application->find('foo2:command'); - $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist'); + $this->fail('->find() throws a CommandNotFoundException if namespace does not exist'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist'); - $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative'); - $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo"'); - $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo1"'); - $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo3"'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist'); + $this->assertCount(3, $e->getAlternatives()); + $this->assertContains('foo', $e->getAlternatives()); + $this->assertContains('foo1', $e->getAlternatives()); + $this->assertContains('foo3', $e->getAlternatives()); + $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative'); + $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"'); + $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"'); + $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"'); } } public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getNamespaces'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces')); $application->expects($this->once()) ->method('getNamespaces') ->will($this->returnValue(array('foo:sublong', 'bar:sub'))); @@ -473,7 +463,7 @@ public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces() } /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException * @expectedExceptionMessage Command "foo::bar" is not defined. */ public function testFindWithDoubleColonInNameThrowsException() @@ -486,7 +476,7 @@ public function testFindWithDoubleColonInNameThrowsException() public function testSetCatchExceptions() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); $application->setAutoExit(false); $application->expects($this->any()) ->method('getTerminalWidth') @@ -507,33 +497,9 @@ public function testSetCatchExceptions() } } - /** - * @group legacy - */ - public function testLegacyAsText() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->ensureStaticCommandHelp($application); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $this->normalizeLineBreaks($application->asText()), '->asText() returns a text representation of the application'); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application'); - } - - /** - * @group legacy - */ - public function testLegacyAsXml() - { - $application = new Application(); - $application->add(new \FooCommand()); - $this->ensureStaticCommandHelp($application); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application'); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application'); - } - public function testRenderException() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); $application->setAutoExit(false); $application->expects($this->any()) ->method('getTerminalWidth') @@ -557,7 +523,7 @@ public function testRenderException() $tester->run(array('command' => 'foo3:bar'), array('decorated' => true)); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); $application->setAutoExit(false); $application->expects($this->any()) ->method('getTerminalWidth') @@ -568,12 +534,9 @@ public function testRenderException() $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal'); } - /** - * @requires extension mbstring - */ public function testRenderExceptionWithDoubleWidthCharacters() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); $application->setAutoExit(false); $application->expects($this->any()) ->method('getTerminalWidth') @@ -589,7 +552,7 @@ public function testRenderExceptionWithDoubleWidthCharacters() $tester->run(array('command' => 'foo'), array('decorated' => true)); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions'); - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth')); $application->setAutoExit(false); $application->expects($this->any()) ->method('getTerminalWidth') @@ -602,38 +565,6 @@ public function testRenderExceptionWithDoubleWidthCharacters() $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal'); } - public function testRenderExceptionEscapesLines() - { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(22)); - $application->register('foo')->setCode(function () { - throw new \Exception('dont break here !'); - }); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting'); - } - - public function testRenderExceptionLineBreaks() - { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); - $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(120)); - $application->register('foo')->setCode(function () { - throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n"); - }); - $tester = new ApplicationTester($application); - - $tester->run(array('command' => 'foo'), array('decorated' => false)); - $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks'); - } - public function testRun() { $application = new Application(); @@ -685,11 +616,9 @@ public function testRun() $tester->run(array('command' => 'list', '--quiet' => true)); $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed'); - $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed'); $tester->run(array('command' => 'list', '-q' => true)); $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed'); - $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed'); $tester->run(array('command' => 'list', '--verbose' => true)); $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed'); @@ -747,23 +676,19 @@ public function testVerboseValueNotBreakArguments() $input = new ArgvInput(array('cli.php', '-v', 'foo:bar')); $application->run($input, $output); - $this->addToAssertionCount(1); - $input = new ArgvInput(array('cli.php', '--verbose', 'foo:bar')); $application->run($input, $output); - - $this->addToAssertionCount(1); } public function testRunReturnsIntegerExitCode() { $exception = new \Exception('', 4); - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('doRun')); $application->setAutoExit(false); $application->expects($this->once()) - ->method('doRun') - ->will($this->throwException($exception)); + ->method('doRun') + ->will($this->throwException($exception)); $exitCode = $application->run(new ArrayInput(array()), new NullOutput()); @@ -774,11 +699,11 @@ public function testRunReturnsExitCodeOneForExceptionCodeZero() { $exception = new \Exception('', 0); - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock(); + $application = $this->getMock('Symfony\Component\Console\Application', array('doRun')); $application->setAutoExit(false); $application->expects($this->once()) - ->method('doRun') - ->will($this->throwException($exception)); + ->method('doRun') + ->will($this->throwException($exception)); $exitCode = $application->run(new ArrayInput(array()), new NullOutput()); @@ -850,8 +775,6 @@ public function testGetDefaultHelperSetReturnsDefaultValues() $helperSet = $application->getHelperSet(); $this->assertTrue($helperSet->has('formatter')); - $this->assertTrue($helperSet->has('dialog')); - $this->assertTrue($helperSet->has('progress')); } public function testAddingSingleHelperSetOverwritesDefaultValues() @@ -1004,15 +927,10 @@ public function testRunDispatchesAllEventsWithException() $this->assertContains('before.foo.caught.after.', $tester->getDisplay()); } - public function testRunDispatchesAllEventsWithExceptionInListener() + public function testRunWithDispatcherSkippingCommand() { - $dispatcher = $this->getDispatcher(); - $dispatcher->addListener('console.command', function () { - throw new \RuntimeException('foo'); - }); - $application = new Application(); - $application->setDispatcher($dispatcher); + $application->setDispatcher($this->getDispatcher(true)); $application->setAutoExit(false); $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { @@ -1020,92 +938,56 @@ public function testRunDispatchesAllEventsWithExceptionInListener() }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'foo')); - $this->assertContains('before.caught.after.', $tester->getDisplay()); + $exitCode = $tester->run(array('command' => 'foo')); + $this->assertContains('before.after.', $tester->getDisplay()); + $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode); } - public function testRunWithError() + public function testRunWithDispatcherAccessingInputOptions() { - $application = new Application(); - $application->setAutoExit(false); - $application->setCatchExceptions(false); + $noInteractionValue = null; + $quietValue = null; - $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('dym.'); + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$noInteractionValue, &$quietValue) { + $input = $event->getInput(); - throw new \Error('dymerr'); + $noInteractionValue = $input->getOption('no-interaction'); + $quietValue = $input->getOption('quiet'); }); - $tester = new ApplicationTester($application); - - try { - $tester->run(array('command' => 'dym')); - $this->fail('Error expected.'); - } catch (\Error $e) { - $this->assertSame('dymerr', $e->getMessage()); - } - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage caught - */ - public function testRunWithErrorAndDispatcher() - { $application = new Application(); - $application->setDispatcher($this->getDispatcher()); + $application->setDispatcher($dispatcher); $application->setAutoExit(false); - $application->setCatchExceptions(false); - - $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('dym.'); - throw new \Error('dymerr'); + $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { + $output->write('foo.'); }); $tester = new ApplicationTester($application); - $tester->run(array('command' => 'dym')); - $this->assertContains('before.dym.caught.after.', $tester->getDisplay(), 'The PHP Error did not dispached events'); - } - - public function testRunDispatchesAllEventsWithError() - { - $application = new Application(); - $application->setDispatcher($this->getDispatcher()); - $application->setAutoExit(false); + $tester->run(array('command' => 'foo', '--no-interaction' => true)); - $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('dym.'); - - throw new \Error('dymerr'); - }); - - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'dym')); - $this->assertContains('before.dym.caught.after.', $tester->getDisplay(), 'The PHP Error did not dispached events'); + $this->assertTrue($noInteractionValue); + $this->assertFalse($quietValue); } - public function testRunWithErrorFailingStatusCode() + public function testRunWithDispatcherAddingInputOptions() { - $application = new Application(); - $application->setDispatcher($this->getDispatcher()); - $application->setAutoExit(false); + $extraValue = null; - $application->register('dus')->setCode(function (InputInterface $input, OutputInterface $output) { - $output->write('dus.'); + $dispatcher = $this->getDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$extraValue) { + $definition = $event->getCommand()->getDefinition(); + $input = $event->getInput(); - throw new \Error('duserr'); - }); + $definition->addOption(new InputOption('extra', null, InputOption::VALUE_REQUIRED)); + $input->bind($definition); - $tester = new ApplicationTester($application); - $tester->run(array('command' => 'dus')); - $this->assertSame(1, $tester->getStatusCode(), 'Status code should be 1'); - } + $extraValue = $input->getOption('extra'); + }); - public function testRunWithDispatcherSkippingCommand() - { $application = new Application(); - $application->setDispatcher($this->getDispatcher(true)); + $application->setDispatcher($dispatcher); $application->setAutoExit(false); $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) { @@ -1113,9 +995,9 @@ public function testRunWithDispatcherSkippingCommand() }); $tester = new ApplicationTester($application); - $exitCode = $tester->run(array('command' => 'foo')); - $this->assertContains('before.after.', $tester->getDisplay()); - $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode); + $tester->run(array('command' => 'foo', '--extra' => 'some test value')); + + $this->assertEquals('some test value', $extraValue); } public function testTerminalDimensions() @@ -1133,31 +1015,35 @@ public function testTerminalDimensions() $this->assertSame(array($width, 80), $application->getTerminalDimensions()); } - public function testSetRunCustomDefaultCommand() + protected function getDispatcher($skipCommand = false) { - $command = new \FooCommand(); - - $application = new Application(); - $application->setAutoExit(false); - $application->add($command); - $application->setDefaultCommand($command->getName()); + $dispatcher = new EventDispatcher(); + $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) { + $event->getOutput()->write('before.'); - $tester = new ApplicationTester($application); - $tester->run(array(), array('interactive' => false)); - $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + if ($skipCommand) { + $event->disableCommand(); + } + }); + $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) { + $event->getOutput()->writeln('after.'); - $application = new CustomDefaultCommandApplication(); - $application->setAutoExit(false); + if (!$skipCommand) { + $event->setExitCode(113); + } + }); + $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) { + $event->getOutput()->write('caught.'); - $tester = new ApplicationTester($application); - $tester->run(array(), array('interactive' => false)); + $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException())); + }); - $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + return $dispatcher; } - public function testSetRunCustomDefaultCommandWithOption() + public function testSetRunCustomDefaultCommand() { - $command = new \FooOptCommand(); + $command = new \FooCommand(); $application = new Application(); $application->setAutoExit(false); @@ -1165,9 +1051,16 @@ public function testSetRunCustomDefaultCommandWithOption() $application->setDefaultCommand($command->getName()); $tester = new ApplicationTester($application); - $tester->run(array('--fooopt' => 'opt'), array('interactive' => false)); + $tester->run(array()); + $this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + + $application = new CustomDefaultCommandApplication(); + $application->setAutoExit(false); + + $tester = new ApplicationTester($application); + $tester->run(array()); - $this->assertEquals('called'.PHP_EOL.'opt'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); + $this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command'); } /** @@ -1186,55 +1079,6 @@ public function testCanCheckIfTerminalIsInteractive() $inputStream = $application->getHelperSet()->get('question')->getInputStream(); $this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream)); } - - protected function getDispatcher($skipCommand = false) - { - $dispatcher = new EventDispatcher(); - $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) { - $event->getOutput()->write('before.'); - - if ($skipCommand) { - $event->disableCommand(); - } - }); - $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) { - $event->getOutput()->writeln('after.'); - - if (!$skipCommand) { - $event->setExitCode(ConsoleCommandEvent::RETURN_CODE_DISABLED); - } - }); - $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) { - $event->getOutput()->write('caught.'); - - $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException())); - }); - - return $dispatcher; - } - - /** - * @requires PHP 7 - */ - public function testErrorIsRethrownIfNotHandledByConsoleErrorEventWithCatchingEnabled() - { - $application = new Application(); - $application->setAutoExit(false); - $application->setDispatcher(new EventDispatcher()); - - $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) { - new \UnknownClass(); - }); - - $tester = new ApplicationTester($application); - - try { - $tester->run(array('command' => 'dym')); - $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.'); - } catch (\Error $e) { - $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found'); - } - } } class CustomApplication extends Application diff --git a/application/vendor/symfony/console/Tests/Command/CommandTest.php b/application/vendor/symfony/console/Tests/Command/CommandTest.php index e129029..53a6009 100644 --- a/application/vendor/symfony/console/Tests/Command/CommandTest.php +++ b/application/vendor/symfony/console/Tests/Command/CommandTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console\Tests\Command; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\FormatterHelper; use Symfony\Component\Console\Application; @@ -24,7 +23,7 @@ use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Tester\CommandTester; -class CommandTest extends TestCase +class CommandTest extends \PHPUnit_Framework_TestCase { protected static $fixturesPath; @@ -55,14 +54,6 @@ public function testSetApplication() $command = new \TestCommand(); $command->setApplication($application); $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application'); - $this->assertEquals($application->getHelperSet(), $command->getHelperSet()); - } - - public function testSetApplicationNull() - { - $command = new \TestCommand(); - $command->setApplication(null); - $this->assertNull($command->getHelperSet()); } public function testSetGetDefinition() @@ -110,12 +101,7 @@ public function testGetNamespaceGetNameSetName() */ public function testInvalidCommandNames($name) { - if (method_exists($this, 'expectException')) { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage(sprintf('Command name "%s" is invalid.', $name)); - } else { - $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name)); - } + $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name)); $command = new \TestCommand(); $command->setName($name); @@ -170,13 +156,6 @@ public function testGetSetAliases() $this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases'); } - public function testSetAliasesNull() - { - $command = new \TestCommand(); - $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException'); - $command->setAliases(null); - } - public function testGetSynopsis() { $command = new \TestCommand(); @@ -185,15 +164,6 @@ public function testGetSynopsis() $this->assertEquals('namespace:name [--foo] [--] []', $command->getSynopsis(), '->getSynopsis() returns the synopsis'); } - public function testAddGetUsages() - { - $command = new \TestCommand(); - $command->addUsage('foo1'); - $command->addUsage('foo2'); - $this->assertContains('namespace:name foo1', $command->getUsages()); - $this->assertContains('namespace:name foo2', $command->getUsages()); - } - public function testGetHelper() { $application = new Application(); @@ -287,7 +257,7 @@ public function testExecuteMethodNeedsToBeOverridden() } /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\InvalidOptionException * @expectedExceptionMessage The "--bar" option does not exist. */ public function testRunWithInvalidOption() @@ -303,10 +273,10 @@ public function testRunReturnsIntegerExitCode() $exitCode = $command->run(new StringInput(''), new NullOutput()); $this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)'); - $command = $this->getMockBuilder('TestCommand')->setMethods(array('execute'))->getMock(); + $command = $this->getMock('TestCommand', array('execute')); $command->expects($this->once()) - ->method('execute') - ->will($this->returnValue('2.3')); + ->method('execute') + ->will($this->returnValue('2.3')); $exitCode = $command->run(new StringInput(''), new NullOutput()); $this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)'); } @@ -327,20 +297,6 @@ public function testRunReturnsAlwaysInteger() $this->assertSame(0, $command->run(new StringInput(''), new NullOutput())); } - public function testRunWithProcessTitle() - { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $command->setProcessTitle('foo'); - $this->assertSame(0, $command->run(new StringInput(''), new NullOutput())); - if (function_exists('cli_set_process_title')) { - if (null === @cli_get_process_title() && 'Darwin' === PHP_OS) { - $this->markTestSkipped('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.'); - } - $this->assertEquals('foo', cli_get_process_title()); - } - } - public function testSetCode() { $command = new \TestCommand(); @@ -353,52 +309,52 @@ public function testSetCode() $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); } - public function testSetCodeWithNonClosureCallable() + public function getSetCodeBindToClosureTests() { - $command = new \TestCommand(); - $ret = $command->setCode(array($this, 'callableMethodCommand')); - $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); - $tester = new CommandTester($command); - $tester->execute(array()); - $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); + return array( + array(true, 'not bound to the command'), + array(false, 'bound to the command'), + ); } /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid callable provided to Command::setCode. + * @dataProvider getSetCodeBindToClosureTests */ - public function testSetCodeWithNonCallable() + public function testSetCodeBindToClosure($previouslyBound, $expected) { - $command = new \TestCommand(); - $command->setCode(array($this, 'nonExistentMethod')); - } + $code = createClosure(); + if ($previouslyBound) { + $code = $code->bindTo($this); + } - public function callableMethodCommand(InputInterface $input, OutputInterface $output) - { - $output->writeln('from the code...'); + $command = new \TestCommand(); + $command->setCode($code); + $tester = new CommandTester($command); + $tester->execute(array()); + $this->assertEquals('interact called'.PHP_EOL.$expected.PHP_EOL, $tester->getDisplay()); } - /** - * @group legacy - */ - public function testLegacyAsText() + public function testSetCodeWithNonClosureCallable() { $command = new \TestCommand(); - $command->setApplication(new Application()); + $ret = $command->setCode(array($this, 'callableMethodCommand')); + $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command'); + $tester->execute(array()); + $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay()); } - /** - * @group legacy - */ - public function testLegacyAsXml() + public function callableMethodCommand(InputInterface $input, OutputInterface $output) { - $command = new \TestCommand(); - $command->setApplication(new Application()); - $tester = new CommandTester($command); - $tester->execute(array('command' => $command->getName())); - $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/command_asxml.txt', $command->asXml(), '->asXml() returns an XML representation of the command'); + $output->writeln('from the code...'); } } + +// In order to get an unbound closure, we should create it outside a class +// scope. +function createClosure() +{ + return function (InputInterface $input, OutputInterface $output) { + $output->writeln($this instanceof Command ? 'bound to the command' : 'not bound to the command'); + }; +} diff --git a/application/vendor/symfony/console/Tests/Command/HelpCommandTest.php b/application/vendor/symfony/console/Tests/Command/HelpCommandTest.php index a4e032a..10bb324 100644 --- a/application/vendor/symfony/console/Tests/Command/HelpCommandTest.php +++ b/application/vendor/symfony/console/Tests/Command/HelpCommandTest.php @@ -11,13 +11,12 @@ namespace Symfony\Component\Console\Tests\Command; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Command\HelpCommand; use Symfony\Component\Console\Command\ListCommand; use Symfony\Component\Console\Application; -class HelpCommandTest extends TestCase +class HelpCommandTest extends \PHPUnit_Framework_TestCase { public function testExecuteForCommandAlias() { @@ -65,7 +64,7 @@ public function testExecuteForApplicationCommandWithXmlOption() $application = new Application(); $commandTester = new CommandTester($application->get('help')); $commandTester->execute(array('command_name' => 'list', '--format' => 'xml')); - $this->assertContains('list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); + $this->assertContains('list [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); $this->assertContains('getDisplay(), '->execute() returns an XML help text if --format=xml is passed'); } } diff --git a/application/vendor/symfony/console/Tests/Command/ListCommandTest.php b/application/vendor/symfony/console/Tests/Command/ListCommandTest.php index fb6ee3b..a166a04 100644 --- a/application/vendor/symfony/console/Tests/Command/ListCommandTest.php +++ b/application/vendor/symfony/console/Tests/Command/ListCommandTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Console\Tests\Command; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Application; -class ListCommandTest extends TestCase +class ListCommandTest extends \PHPUnit_Framework_TestCase { public function testExecuteListsCommands() { diff --git a/application/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php b/application/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php index fcbb719..c36c4a8 100644 --- a/application/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php +++ b/application/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console\Tests\Descriptor; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -19,7 +18,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\BufferedOutput; -abstract class AbstractDescriptorTest extends TestCase +abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase { /** @dataProvider getDescribeInputArgumentTestData */ public function testDescribeInputArgument(InputArgument $argument, $expectedDescription) @@ -87,7 +86,7 @@ abstract protected function getDescriptor(); abstract protected function getFormat(); - protected function getDescriptionTestData(array $objects) + private function getDescriptionTestData(array $objects) { $data = array(); foreach ($objects as $name => $object) { diff --git a/application/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php b/application/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php index eb80f58..c85e8a5 100644 --- a/application/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php +++ b/application/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php @@ -12,27 +12,9 @@ namespace Symfony\Component\Console\Tests\Descriptor; use Symfony\Component\Console\Descriptor\MarkdownDescriptor; -use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString; -use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString; class MarkdownDescriptorTest extends AbstractDescriptorTest { - public function getDescribeCommandTestData() - { - return $this->getDescriptionTestData(array_merge( - ObjectsProvider::getCommands(), - array('command_mbstring' => new DescriptorCommandMbString()) - )); - } - - public function getDescribeApplicationTestData() - { - return $this->getDescriptionTestData(array_merge( - ObjectsProvider::getApplications(), - array('application_mbstring' => new DescriptorApplicationMbString()) - )); - } - protected function getDescriptor() { return new MarkdownDescriptor(); diff --git a/application/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php b/application/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php index b4f34ad..45b3b2f 100644 --- a/application/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php +++ b/application/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php @@ -31,8 +31,6 @@ public static function getInputArguments() 'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'), 'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'), 'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"), - 'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'style'), - 'input_argument_with_default_inf_value' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', INF), ); } @@ -45,9 +43,6 @@ public static function getInputOptions() 'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()), 'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"), 'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'), - 'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', 'style'), - 'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('Hello', 'world')), - 'input_option_with_default_inf_value' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', INF), ); } diff --git a/application/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php b/application/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php index 364e29c..350b679 100644 --- a/application/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php +++ b/application/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php @@ -12,27 +12,9 @@ namespace Symfony\Component\Console\Tests\Descriptor; use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString; -use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString; class TextDescriptorTest extends AbstractDescriptorTest { - public function getDescribeCommandTestData() - { - return $this->getDescriptionTestData(array_merge( - ObjectsProvider::getCommands(), - array('command_mbstring' => new DescriptorCommandMbString()) - )); - } - - public function getDescribeApplicationTestData() - { - return $this->getDescriptionTestData(array_merge( - ObjectsProvider::getApplications(), - array('application_mbstring' => new DescriptorApplicationMbString()) - )); - } - protected function getDescriptor() { return new TextDescriptor(); diff --git a/application/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php b/application/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php deleted file mode 100644 index bf170c4..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Application; - -class DescriptorApplicationMbString extends Application -{ - public function __construct() - { - parent::__construct('MbString åpplicätion'); - - $this->add(new DescriptorCommandMbString()); - } -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php b/application/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php deleted file mode 100644 index 66de917..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Fixtures; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputOption; - -class DescriptorCommandMbString extends Command -{ - protected function configure() - { - $this - ->setName('descriptor:åèä') - ->setDescription('command åèä description') - ->setHelp('command åèä help') - ->addUsage('-o|--option_name ') - ->addUsage('') - ->addArgument('argument_åèä', InputArgument::REQUIRED) - ->addOption('option_åèä', 'o', InputOption::VALUE_NONE) - ; - } -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/DummyOutput.php b/application/vendor/symfony/console/Tests/Fixtures/DummyOutput.php index 866e214..0070c0a 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/DummyOutput.php +++ b/application/vendor/symfony/console/Tests/Fixtures/DummyOutput.php @@ -26,7 +26,7 @@ class DummyOutput extends BufferedOutput public function getLogs() { $logs = array(); - foreach (explode(PHP_EOL, trim($this->fetch())) as $message) { + foreach (explode("\n", trim($this->fetch())) as $message) { preg_match('/^\[(.*)\] (.*)/', $message, $matches); $logs[] = sprintf('%s %s', $matches[1], $matches[2]); } diff --git a/application/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php b/application/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php deleted file mode 100644 index 9043aa4..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php +++ /dev/null @@ -1,36 +0,0 @@ -setName('foo:bar') - ->setDescription('The foo:bar command') - ->setAliases(array('afoobar')) - ->addOption('fooopt', 'fo', InputOption::VALUE_OPTIONAL, 'fooopt description') - ; - } - - protected function interact(InputInterface $input, OutputInterface $output) - { - $output->writeln('interact called'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->output = $output; - - $output->writeln('called'); - $output->writeln($this->input->getOption('fooopt')); - } -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php index a4ef74e..678afea 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php @@ -4,7 +4,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength; -//Ensure long words are properly wrapped in blocks +// ensure long words are properly wrapped in blocks return function (InputInterface $input, OutputInterface $output) { $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon'; $sfStyle = new SymfonyStyleWithForcedLineLength($input, $output); diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php index e6a1355..4386e56 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php @@ -4,10 +4,10 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength; -//Ensure symfony style helper methods handle trailing backslashes properly when decorating user texts +// ensure that all lines are aligned to the begin of the first one and start with '//' in a very long line comment return function (InputInterface $input, OutputInterface $output) { $output = new SymfonyStyleWithForcedLineLength($input, $output); - - $output->title('Title ending with \\'); - $output->section('Section ending with \\'); + $output->comment( + 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum' + ); }; diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php new file mode 100644 index 0000000..fe08436 --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php @@ -0,0 +1,15 @@ +setDecorated(true); + $output = new SymfonyStyle($input, $output); + $output->comment( + 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum' + ); +}; diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php new file mode 100644 index 0000000..e719f71 --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php @@ -0,0 +1,17 @@ +block( + 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', + null, + null, + '$ ', + true + ); +}; diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php new file mode 100644 index 0000000..29e555b --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php @@ -0,0 +1,14 @@ +block( + 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', + 'TEST' + ); +}; diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php new file mode 100644 index 0000000..f21fc10 --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php @@ -0,0 +1,15 @@ +setDecorated(true); + $output = new SymfonyStyleWithForcedLineLength($input, $output); + $output->success( + 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', + 'TEST' + ); +}; diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php index 2cc2ca0..d2c68a9 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php @@ -4,7 +4,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength; -//Ensure has proper line ending before outputting a text block like with SymfonyStyle::listing() or SymfonyStyle::text() +//Ensure has proper line ending before outputing a text block like with SymfonyStyle::listing() or SymfonyStyle::text() return function (InputInterface $input, OutputInterface $output) { $output = new SymfonyStyleWithForcedLineLength($input, $output); @@ -26,4 +26,12 @@ 'Lorem ipsum dolor sit amet', 'consectetur adipiscing elit', )); + + $output->newLine(); + + $output->write('Lorem ipsum dolor sit amet'); + $output->comment(array( + 'Lorem ipsum dolor sit amet', + 'consectetur adipiscing elit', + )); }; diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt index 59d00e0..9983af8 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt @@ -1,7 +1,6 @@ -Title ending with \ -=================== - -Section ending with \ ---------------------- + // Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + // aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. + // Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur + // sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt new file mode 100644 index 0000000..0f3704b --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt @@ -0,0 +1,7 @@ + + // Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et  + // dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea  + // commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla  + // pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim + // id est laborum + diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt new file mode 100644 index 0000000..1d0d37e --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt @@ -0,0 +1,6 @@ + +$ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna +$ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +$ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint +$ occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum + diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt new file mode 100644 index 0000000..66404b8 --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt @@ -0,0 +1,7 @@ + + [TEST] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore + magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est + laborum + diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt new file mode 100644 index 0000000..a0d1801 --- /dev/null +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt @@ -0,0 +1,8 @@ + +  + [OK] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore  + magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo  + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.  + Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum  +  + diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt index 910240f..be4a2db 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt @@ -7,5 +7,12 @@ Lorem ipsum dolor sit amet * consectetur adipiscing elit Lorem ipsum dolor sit amet - // Lorem ipsum dolor sit amet - // consectetur adipiscing elit + Lorem ipsum dolor sit amet + consectetur adipiscing elit + +Lorem ipsum dolor sit amet + + // Lorem ipsum dolor sit amet + // + // consectetur adipiscing elit + diff --git a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt index ab18e5d..ecea977 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt @@ -2,4 +2,4 @@ Title ===== - // Duis aute irure dolor in reprehenderit in voluptate velit esse + Duis aute irure dolor in reprehenderit in voluptate velit esse diff --git a/application/vendor/symfony/console/Tests/Fixtures/TestTiti.php b/application/vendor/symfony/console/Tests/Fixtures/TestTiti.php deleted file mode 100644 index 72e29d2..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/TestTiti.php +++ /dev/null @@ -1,21 +0,0 @@ -setName('test-titi') - ->setDescription('The test:titi command') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $output->write('test-titi'); - } -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/TestToto.php b/application/vendor/symfony/console/Tests/Fixtures/TestToto.php deleted file mode 100644 index f14805d..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/TestToto.php +++ /dev/null @@ -1,22 +0,0 @@ -setName('test-toto') - ->setDescription('The test-toto command') - ->setAliases(array('test')) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $output->write('test-toto'); - } -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_1.json b/application/vendor/symfony/console/Tests/Fixtures/application_1.json index ea695a7..b3ad97d 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_1.json +++ b/application/vendor/symfony/console/Tests/Fixtures/application_1.json @@ -1,172 +1 @@ -{ - "commands": [ - { - "name": "help", - "usage": [ - "help [--xml] [--format FORMAT] [--raw] [--] []" - ], - "description": "Displays help for a command", - "help": "The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.", - "definition": { - "arguments": { - "command_name": { - "name": "command_name", - "is_required": false, - "is_array": false, - "description": "The command name", - "default": "help" - } - }, - "options": { - "xml": { - "name": "--xml", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output help as XML", - "default": false - }, - "format": { - "name": "--format", - "shortcut": "", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "The output format (txt, xml, json, or md)", - "default": "txt" - }, - "raw": { - "name": "--raw", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output raw command help", - "default": false - }, - "help": { - "name": "--help", - "shortcut": "-h", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this help message", - "default": false - }, - "quiet": { - "name": "--quiet", - "shortcut": "-q", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not output any message", - "default": false - }, - "verbose": { - "name": "--verbose", - "shortcut": "-v|-vv|-vvv", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", - "default": false - }, - "version": { - "name": "--version", - "shortcut": "-V", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this application version", - "default": false - }, - "ansi": { - "name": "--ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Force ANSI output", - "default": false - }, - "no-ansi": { - "name": "--no-ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Disable ANSI output", - "default": false - }, - "no-interaction": { - "name": "--no-interaction", - "shortcut": "-n", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not ask any interactive question", - "default": false - } - } - } - }, - { - "name": "list", - "usage": [ - "list [--xml] [--raw] [--format FORMAT] [--] []" - ], - "description": "Lists commands", - "help": "The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>", - "definition": { - "arguments": { - "namespace": { - "name": "namespace", - "is_required": false, - "is_array": false, - "description": "The namespace name", - "default": null - } - }, - "options": { - "xml": { - "name": "--xml", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output list as XML", - "default": false - }, - "raw": { - "name": "--raw", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output raw command list", - "default": false - }, - "format": { - "name": "--format", - "shortcut": "", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "The output format (txt, xml, json, or md)", - "default": "txt" - } - } - } - } - ], - "namespaces": [ - { - "id": "_global", - "commands": [ - "help", - "list" - ] - } - ] -} +{"commands":[{"name":"help","usage":["help [--format FORMAT] [--raw] [--] []"],"description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--raw] [--format FORMAT] [--] []"],"description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]} diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_1.md b/application/vendor/symfony/console/Tests/Fixtures/application_1.md index 82a605d..f1d88c5 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_1.md +++ b/application/vendor/symfony/console/Tests/Fixtures/application_1.md @@ -10,7 +10,7 @@ help * Description: Displays help for a command * Usage: - * `help [--xml] [--format FORMAT] [--raw] [--] []` + * `help [--format FORMAT] [--raw] [--] []` The help command displays help for a given command: @@ -34,16 +34,6 @@ To display the list of available commands, please use the list comm ### Options: -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output help as XML -* Default: `false` - **format:** * Name: `--format` @@ -140,7 +130,7 @@ list * Description: Lists commands * Usage: - * `list [--xml] [--raw] [--format FORMAT] [--] []` + * `list [--raw] [--format FORMAT] [--] []` The list command lists all commands: @@ -170,16 +160,6 @@ It's also possible to get raw list of commands (useful for embedding command run ### Options: -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output list as XML -* Default: `false` - **raw:** * Name: `--raw` diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_1.xml b/application/vendor/symfony/console/Tests/Fixtures/application_1.xml index 35d1db4..8514f23 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_1.xml +++ b/application/vendor/symfony/console/Tests/Fixtures/application_1.xml @@ -3,7 +3,7 @@ - help [--xml] [--format FORMAT] [--raw] [--] [<command_name>] + help [--format FORMAT] [--raw] [--] [<command_name>] Displays help for a command The <info>help</info> command displays help for a given command: @@ -24,9 +24,6 @@ - - list [--xml] [--raw] [--format FORMAT] [--] [<namespace>] + list [--raw] [--format FORMAT] [--] [<namespace>] Lists commands The <info>list</info> command lists all commands: @@ -86,9 +83,6 @@ - diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_2.json b/application/vendor/symfony/console/Tests/Fixtures/application_2.json index 8ffa222..e8870ba 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_2.json +++ b/application/vendor/symfony/console/Tests/Fixtures/application_2.json @@ -1,354 +1 @@ -{ - "commands": [ - { - "name": "help", - "usage": [ - "help [--xml] [--format FORMAT] [--raw] [--] []" - ], - "description": "Displays help for a command", - "help": "The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.", - "definition": { - "arguments": { - "command_name": { - "name": "command_name", - "is_required": false, - "is_array": false, - "description": "The command name", - "default": "help" - } - }, - "options": { - "xml": { - "name": "--xml", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output help as XML", - "default": false - }, - "format": { - "name": "--format", - "shortcut": "", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "The output format (txt, xml, json, or md)", - "default": "txt" - }, - "raw": { - "name": "--raw", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output raw command help", - "default": false - }, - "help": { - "name": "--help", - "shortcut": "-h", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this help message", - "default": false - }, - "quiet": { - "name": "--quiet", - "shortcut": "-q", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not output any message", - "default": false - }, - "verbose": { - "name": "--verbose", - "shortcut": "-v|-vv|-vvv", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", - "default": false - }, - "version": { - "name": "--version", - "shortcut": "-V", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this application version", - "default": false - }, - "ansi": { - "name": "--ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Force ANSI output", - "default": false - }, - "no-ansi": { - "name": "--no-ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Disable ANSI output", - "default": false - }, - "no-interaction": { - "name": "--no-interaction", - "shortcut": "-n", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not ask any interactive question", - "default": false - } - } - } - }, - { - "name": "list", - "usage": [ - "list [--xml] [--raw] [--format FORMAT] [--] []" - ], - "description": "Lists commands", - "help": "The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>", - "definition": { - "arguments": { - "namespace": { - "name": "namespace", - "is_required": false, - "is_array": false, - "description": "The namespace name", - "default": null - } - }, - "options": { - "xml": { - "name": "--xml", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output list as XML", - "default": false - }, - "raw": { - "name": "--raw", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "To output raw command list", - "default": false - }, - "format": { - "name": "--format", - "shortcut": "", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "The output format (txt, xml, json, or md)", - "default": "txt" - } - } - } - }, - { - "name": "descriptor:command1", - "usage": [ - "descriptor:command1", - "alias1", - "alias2" - ], - "description": "command 1 description", - "help": "command 1 help", - "definition": { - "arguments": [], - "options": { - "help": { - "name": "--help", - "shortcut": "-h", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this help message", - "default": false - }, - "quiet": { - "name": "--quiet", - "shortcut": "-q", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not output any message", - "default": false - }, - "verbose": { - "name": "--verbose", - "shortcut": "-v|-vv|-vvv", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", - "default": false - }, - "version": { - "name": "--version", - "shortcut": "-V", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this application version", - "default": false - }, - "ansi": { - "name": "--ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Force ANSI output", - "default": false - }, - "no-ansi": { - "name": "--no-ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Disable ANSI output", - "default": false - }, - "no-interaction": { - "name": "--no-interaction", - "shortcut": "-n", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not ask any interactive question", - "default": false - } - } - } - }, - { - "name": "descriptor:command2", - "usage": [ - "descriptor:command2 [-o|--option_name] [--] ", - "descriptor:command2 -o|--option_name ", - "descriptor:command2 " - ], - "description": "command 2 description", - "help": "command 2 help", - "definition": { - "arguments": { - "argument_name": { - "name": "argument_name", - "is_required": true, - "is_array": false, - "description": "", - "default": null - } - }, - "options": { - "option_name": { - "name": "--option_name", - "shortcut": "-o", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "", - "default": false - }, - "help": { - "name": "--help", - "shortcut": "-h", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this help message", - "default": false - }, - "quiet": { - "name": "--quiet", - "shortcut": "-q", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not output any message", - "default": false - }, - "verbose": { - "name": "--verbose", - "shortcut": "-v|-vv|-vvv", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", - "default": false - }, - "version": { - "name": "--version", - "shortcut": "-V", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Display this application version", - "default": false - }, - "ansi": { - "name": "--ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Force ANSI output", - "default": false - }, - "no-ansi": { - "name": "--no-ansi", - "shortcut": "", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Disable ANSI output", - "default": false - }, - "no-interaction": { - "name": "--no-interaction", - "shortcut": "-n", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "Do not ask any interactive question", - "default": false - } - } - } - } - ], - "namespaces": [ - { - "id": "_global", - "commands": [ - "alias1", - "alias2", - "help", - "list" - ] - }, - { - "id": "descriptor", - "commands": [ - "descriptor:command1", - "descriptor:command2" - ] - } - ] -} +{"commands":[{"name":"help","usage":["help [--format FORMAT] [--raw] [--] []"],"description":"Displays help for a command","help":"The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--raw] [--format FORMAT] [--] []"],"description":"Lists commands","help":"The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}},{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] ", "descriptor:command2 -o|--option_name ", "descriptor:command2 "],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} \ No newline at end of file diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_2.md b/application/vendor/symfony/console/Tests/Fixtures/application_2.md index f031c9e..63b2d9a 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_2.md +++ b/application/vendor/symfony/console/Tests/Fixtures/application_2.md @@ -17,7 +17,7 @@ help * Description: Displays help for a command * Usage: - * `help [--xml] [--format FORMAT] [--raw] [--] []` + * `help [--format FORMAT] [--raw] [--] []` The help command displays help for a given command: @@ -41,16 +41,6 @@ To display the list of available commands, please use the list comm ### Options: -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output help as XML -* Default: `false` - **format:** * Name: `--format` @@ -147,7 +137,7 @@ list * Description: Lists commands * Usage: - * `list [--xml] [--raw] [--format FORMAT] [--] []` + * `list [--raw] [--format FORMAT] [--] []` The list command lists all commands: @@ -177,16 +167,6 @@ It's also possible to get raw list of commands (useful for embedding command run ### Options: -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output list as XML -* Default: `false` - **raw:** * Name: `--raw` diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_2.xml b/application/vendor/symfony/console/Tests/Fixtures/application_2.xml index bc8ab21..62e3cfc 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_2.xml +++ b/application/vendor/symfony/console/Tests/Fixtures/application_2.xml @@ -3,7 +3,7 @@ - help [--xml] [--format FORMAT] [--raw] [--] [<command_name>] + help [--format FORMAT] [--raw] [--] [<command_name>] Displays help for a command The <info>help</info> command displays help for a given command: @@ -24,9 +24,6 @@ - - list [--xml] [--raw] [--format FORMAT] [--] [<namespace>] + list [--raw] [--format FORMAT] [--] [<namespace>] Lists commands The <info>list</info> command lists all commands: @@ -86,9 +83,6 @@ - diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt b/application/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt deleted file mode 100644 index 8277d9e..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - help [--xml] [--format FORMAT] [--raw] [--] [<command_name>] - - Displays help for a command - The <info>help</info> command displays help for a given command: - - <info>php app/console help list</info> - - You can also output the help in other formats by using the <comment>--format</comment> option: - - <info>php app/console help --format=xml list</info> - - To display the list of available commands, please use the <info>list</info> command. - - - The command name - - help - - - - - - - - - - - - - - - - - - - list [--xml] [--raw] [--format FORMAT] [--] [<namespace>] - - Lists commands - The <info>list</info> command lists all commands: - - <info>php app/console list</info> - - You can also display the commands for a specific namespace: - - <info>php app/console list test</info> - - You can also output the information in other formats by using the <comment>--format</comment> option: - - <info>php app/console list --format=xml</info> - - It's also possible to get raw list of commands (useful for embedding command runner): - - <info>php app/console list --raw</info> - - - The namespace name - - - - - - - - - - - - foo:bar - afoobar - - The foo:bar command - The foo:bar command - - - - - - - - - - - - - - - afoobar - help - list - - - foo:bar - - - diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt b/application/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt deleted file mode 100644 index 93d6d4e..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - foo:bar - afoobar - - The foo:bar command - The foo:bar command - - - - - - - - - - - - - diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_mbstring.md b/application/vendor/symfony/console/Tests/Fixtures/application_mbstring.md deleted file mode 100644 index ef81f86..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/application_mbstring.md +++ /dev/null @@ -1,309 +0,0 @@ -MbString åpplicätion -==================== - -* help -* list - -**descriptor:** - -* descriptor:åèä - -help ----- - -* Description: Displays help for a command -* Usage: - - * `help [--xml] [--format FORMAT] [--raw] [--] []` - -The help command displays help for a given command: - - php app/console help list - -You can also output the help in other formats by using the --format option: - - php app/console help --format=xml list - -To display the list of available commands, please use the list command. - -### Arguments: - -**command_name:** - -* Name: command_name -* Is required: no -* Is array: no -* Description: The command name -* Default: `'help'` - -### Options: - -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output help as XML -* Default: `false` - -**format:** - -* Name: `--format` -* Shortcut: -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: The output format (txt, xml, json, or md) -* Default: `'txt'` - -**raw:** - -* Name: `--raw` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output raw command help -* Default: `false` - -**help:** - -* Name: `--help` -* Shortcut: `-h` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this help message -* Default: `false` - -**quiet:** - -* Name: `--quiet` -* Shortcut: `-q` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not output any message -* Default: `false` - -**verbose:** - -* Name: `--verbose` -* Shortcut: `-v|-vv|-vvv` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug -* Default: `false` - -**version:** - -* Name: `--version` -* Shortcut: `-V` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this application version -* Default: `false` - -**ansi:** - -* Name: `--ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Force ANSI output -* Default: `false` - -**no-ansi:** - -* Name: `--no-ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Disable ANSI output -* Default: `false` - -**no-interaction:** - -* Name: `--no-interaction` -* Shortcut: `-n` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not ask any interactive question -* Default: `false` - -list ----- - -* Description: Lists commands -* Usage: - - * `list [--xml] [--raw] [--format FORMAT] [--] []` - -The list command lists all commands: - - php app/console list - -You can also display the commands for a specific namespace: - - php app/console list test - -You can also output the information in other formats by using the --format option: - - php app/console list --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - php app/console list --raw - -### Arguments: - -**namespace:** - -* Name: namespace -* Is required: no -* Is array: no -* Description: The namespace name -* Default: `NULL` - -### Options: - -**xml:** - -* Name: `--xml` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output list as XML -* Default: `false` - -**raw:** - -* Name: `--raw` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: To output raw command list -* Default: `false` - -**format:** - -* Name: `--format` -* Shortcut: -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: The output format (txt, xml, json, or md) -* Default: `'txt'` - -descriptor:åèä --------------- - -* Description: command åèä description -* Usage: - - * `descriptor:åèä [-o|--option_åèä] [--] ` - * `descriptor:åèä -o|--option_name ` - * `descriptor:åèä ` - -command åèä help - -### Arguments: - -**argument_åèä:** - -* Name: argument_åèä -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` - -### Options: - -**option_åèä:** - -* Name: `--option_åèä` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` - -**help:** - -* Name: `--help` -* Shortcut: `-h` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this help message -* Default: `false` - -**quiet:** - -* Name: `--quiet` -* Shortcut: `-q` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not output any message -* Default: `false` - -**verbose:** - -* Name: `--verbose` -* Shortcut: `-v|-vv|-vvv` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug -* Default: `false` - -**version:** - -* Name: `--version` -* Shortcut: `-V` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Display this application version -* Default: `false` - -**ansi:** - -* Name: `--ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Force ANSI output -* Default: `false` - -**no-ansi:** - -* Name: `--no-ansi` -* Shortcut: -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Disable ANSI output -* Default: `false` - -**no-interaction:** - -* Name: `--no-interaction` -* Shortcut: `-n` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: Do not ask any interactive question -* Default: `false` diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt b/application/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt deleted file mode 100644 index 9d21f82..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt +++ /dev/null @@ -1,19 +0,0 @@ -MbString åpplicätion - -Usage: - command [options] [arguments] - -Options: - -h, --help Display this help message - -q, --quiet Do not output any message - -V, --version Display this application version - --ansi Force ANSI output - --no-ansi Disable ANSI output - -n, --no-interaction Do not ask any interactive question - -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug - -Available commands: - help Displays help for a command - list Lists commands - descriptor - descriptor:åèä command åèä description diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt index c56f4b6..919cec4 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt @@ -1,6 +1,6 @@ - - [InvalidArgumentException] - Command "foo" is not defined. - + + [Symfony\Component\Console\Exception\CommandNotFoundException] + Command "foo" is not defined. + diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt index 58cd420..6456171 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt @@ -1,8 +1,8 @@ - - [InvalidArgumentException] - The "--foo" option does not exist. - + + [Symfony\Component\Console\Exception\InvalidOptionException] + The "--foo" option does not exist. + -list [--xml] [--raw] [--format FORMAT] [--] [] +list [--raw] [--format FORMAT] [--] [] diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt index f41925f..8276137 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt @@ -1,13 +1,13 @@ - - [Exception] - Third exception comment - + + [Exception] + Third exception comment + - - [Exception] - Second exception comment - + + [Exception] + Second exception comment + [Exception] diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt index 5adccdd..b4a7b01 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt @@ -1,17 +1,17 @@ -  - [Exception]  - Third exception comment  -  +  + [Exception]  + Third exception comment  +  -  - [Exception]  - Second exception comment  -  +  + [Exception]  + Second exception comment  +     [Exception]  - First exception

    this is html

     + First exception 

    this is html

        foo3:bar diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt index 9d881e7..cb080e9 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt @@ -1,7 +1,7 @@ - - [InvalidArgumentException] - Command "foo" is not define - d. - + + [Symfony\Component\Console\Exception\CommandNotFoundException] + Command "foo" is not define + d. + diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt deleted file mode 100644 index cf79b37..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt +++ /dev/null @@ -1,9 +0,0 @@ - - - [Exception] - dont break here < - info>!
    - - -foo - diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt b/application/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt deleted file mode 100644 index e9a9518..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt +++ /dev/null @@ -1,11 +0,0 @@ - - - [InvalidArgumentException] - line 1 with extra spaces - line 2 - - line 4 - - -foo - diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_run2.txt b/application/vendor/symfony/console/Tests/Fixtures/application_run2.txt index 06ad09a..0098e9a 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_run2.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_run2.txt @@ -2,11 +2,10 @@ Usage: help [options] [--] [] Arguments: - command The command to execute [default: "list"] + command The command to execute command_name The command name [default: "help"] Options: - --xml To output help as XML --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"] --raw To output raw command help -h, --help Display this help message @@ -18,12 +17,12 @@ Options: -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Help: - The help command displays help for a given command: - - php app/console help list - - You can also output the help in other formats by using the --format option: - - php app/console help --format=xml list - - To display the list of available commands, please use the list command. + The help command displays help for a given command: + + php app/console help list + + You can also output the help in other formats by using the --format option: + + php app/console help --format=xml list + + To display the list of available commands, please use the list command. diff --git a/application/vendor/symfony/console/Tests/Fixtures/application_run3.txt b/application/vendor/symfony/console/Tests/Fixtures/application_run3.txt index 2e8d92e..fe566d7 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/application_run3.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/application_run3.txt @@ -5,23 +5,22 @@ Arguments: namespace The namespace name Options: - --xml To output list as XML --raw To output raw command list --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"] Help: - The list command lists all commands: - - php app/console list - - You can also display the commands for a specific namespace: - - php app/console list test - - You can also output the information in other formats by using the --format option: - - php app/console list --format=xml - - It's also possible to get raw list of commands (useful for embedding command runner): - - php app/console list --raw + The list command lists all commands: + + php app/console list + + You can also display the commands for a specific namespace: + + php app/console list test + + You can also output the information in other formats by using the --format option: + + php app/console list --format=xml + + It's also possible to get raw list of commands (useful for embedding command runner): + + php app/console list --raw diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_1.json b/application/vendor/symfony/console/Tests/Fixtures/command_1.json index 4cd37ee..20f310b 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/command_1.json +++ b/application/vendor/symfony/console/Tests/Fixtures/command_1.json @@ -1,14 +1 @@ -{ - "name": "descriptor:command1", - "usage": [ - "descriptor:command1", - "alias1", - "alias2" - ], - "description": "command 1 description", - "help": "command 1 help", - "definition": { - "arguments": [], - "options": [] - } -} +{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":[]}} diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_1.txt b/application/vendor/symfony/console/Tests/Fixtures/command_1.txt index e5e93ee..28e14a0 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/command_1.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/command_1.txt @@ -4,4 +4,4 @@ alias2 Help: - command 1 help + command 1 help diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_2.json b/application/vendor/symfony/console/Tests/Fixtures/command_2.json index 74c1f12..38edd1e 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/command_2.json +++ b/application/vendor/symfony/console/Tests/Fixtures/command_2.json @@ -1,32 +1 @@ -{ - "name": "descriptor:command2", - "usage": [ - "descriptor:command2 [-o|--option_name] [--] ", - "descriptor:command2 -o|--option_name ", - "descriptor:command2 " - ], - "description": "command 2 description", - "help": "command 2 help", - "definition": { - "arguments": { - "argument_name": { - "name": "argument_name", - "is_required": true, - "is_array": false, - "description": "", - "default": null - } - }, - "options": { - "option_name": { - "name": "--option_name", - "shortcut": "-o", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "", - "default": false - } - } - } -} +{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] ", "descriptor:command2 -o|--option_name ", "descriptor:command2 "],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}} diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_2.txt b/application/vendor/symfony/console/Tests/Fixtures/command_2.txt index 2864c7b..72f7ce0 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/command_2.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/command_2.txt @@ -1,7 +1,7 @@ Usage: - descriptor:command2 [options] [--] \ - descriptor:command2 -o|--option_name \ - descriptor:command2 \ + descriptor:command2 [options] [--] + descriptor:command2 -o|--option_name + descriptor:command2 Arguments: argument_name @@ -10,4 +10,4 @@ -o, --option_name Help: - command 2 help + command 2 help diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_astext.txt b/application/vendor/symfony/console/Tests/Fixtures/command_astext.txt index 4d9055d..7e20638 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/command_astext.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/command_astext.txt @@ -15,4 +15,4 @@ -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Help: - help + help diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_mbstring.md b/application/vendor/symfony/console/Tests/Fixtures/command_mbstring.md deleted file mode 100644 index 2adac53..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/command_mbstring.md +++ /dev/null @@ -1,33 +0,0 @@ -descriptor:åèä --------------- - -* Description: command åèä description -* Usage: - - * `descriptor:åèä [-o|--option_åèä] [--] ` - * `descriptor:åèä -o|--option_name ` - * `descriptor:åèä ` - -command åèä help - -### Arguments: - -**argument_åèä:** - -* Name: argument_åèä -* Is required: yes -* Is array: no -* Description: -* Default: `NULL` - -### Options: - -**option_åèä:** - -* Name: `--option_åèä` -* Shortcut: `-o` -* Accept value: no -* Is value required: no -* Is multiple: no -* Description: -* Default: `false` diff --git a/application/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt b/application/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt deleted file mode 100644 index cde457d..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt +++ /dev/null @@ -1,13 +0,0 @@ -Usage: - descriptor:åèä [options] [--] \ - descriptor:åèä -o|--option_name \ - descriptor:åèä \ - -Arguments: - argument_åèä - -Options: - -o, --option_åèä - -Help: - command åèä help diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_1.json b/application/vendor/symfony/console/Tests/Fixtures/input_argument_1.json index 0ab9329..b8173b6 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_1.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_argument_1.json @@ -1,7 +1 @@ -{ - "name": "argument_name", - "is_required": true, - "is_array": false, - "description": "", - "default": null -} +{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_2.json b/application/vendor/symfony/console/Tests/Fixtures/input_argument_2.json index 7450016..ef06b09 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_2.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_argument_2.json @@ -1,7 +1 @@ -{ - "name": "argument_name", - "is_required": false, - "is_array": true, - "description": "argument description", - "default": [] -} +{"name":"argument_name","is_required":false,"is_array":true,"description":"argument description","default":[]} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_3.json b/application/vendor/symfony/console/Tests/Fixtures/input_argument_3.json index 9a83c5a..de8484e 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_3.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_argument_3.json @@ -1,7 +1 @@ -{ - "name": "argument_name", - "is_required": false, - "is_array": false, - "description": "argument description", - "default": "default_value" -} +{"name":"argument_name","is_required":false,"is_array":false,"description":"argument description","default":"default_value"} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.json b/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.json index cbcb19b..8067a4d 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.json @@ -1,7 +1 @@ -{ - "name": "argument_name", - "is_required": true, - "is_array": false, - "description": "multiline argument description", - "default": null -} +{"name":"argument_name","is_required":true,"is_array":false,"description":"multiline argument description","default":null} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt b/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt index fc7d669..aa74e8c 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt @@ -1,2 +1,2 @@ argument_name multiline - argument description + argument description diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json deleted file mode 100644 index b61ecf7..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "argument_name", - "is_required": false, - "is_array": false, - "description": "argument description", - "default": "INF" -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md deleted file mode 100644 index 293d816..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md +++ /dev/null @@ -1,7 +0,0 @@ -**argument_name:** - -* Name: argument_name -* Is required: no -* Is array: no -* Description: argument description -* Default: `INF` diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt deleted file mode 100644 index c32d768..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt +++ /dev/null @@ -1 +0,0 @@ - argument_name argument description [default: INF] diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml deleted file mode 100644 index d457260..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - argument description - - INF - - diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json deleted file mode 100644 index 9334235..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "argument_name", - "is_required": false, - "is_array": false, - "description": "argument description", - "default": "style" -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md deleted file mode 100644 index 45adf2f..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md +++ /dev/null @@ -1,7 +0,0 @@ -**argument_name:** - -* Name: argument_name -* Is required: no -* Is array: no -* Description: argument description -* Default: `'style'` diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt deleted file mode 100644 index 35384a6..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt +++ /dev/null @@ -1 +0,0 @@ - argument_name argument description [default: "\style\"] diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml b/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml deleted file mode 100644 index 73332c7..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - argument description - - <comment>style</> - - diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_definition_1.json b/application/vendor/symfony/console/Tests/Fixtures/input_definition_1.json index 44aa2c2..c7a7d83 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_definition_1.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_definition_1.json @@ -1,4 +1 @@ -{ - "arguments": [], - "options": [] -} +{"arguments":[],"options":[]} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_definition_2.json b/application/vendor/symfony/console/Tests/Fixtures/input_definition_2.json index 7cfd57e..9964a55 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_definition_2.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_definition_2.json @@ -1,12 +1 @@ -{ - "arguments": { - "argument_name": { - "name": "argument_name", - "is_required": true, - "is_array": false, - "description": "", - "default": null - } - }, - "options": [] -} +{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":[]} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_definition_3.json b/application/vendor/symfony/console/Tests/Fixtures/input_definition_3.json index 3b3cf73..6a86056 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_definition_3.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_definition_3.json @@ -1,14 +1 @@ -{ - "arguments": [], - "options": { - "option_name": { - "name": "--option_name", - "shortcut": "-o", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "", - "default": false - } - } -} +{"arguments":[],"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_definition_4.json b/application/vendor/symfony/console/Tests/Fixtures/input_definition_4.json index d4a51e8..c5a0019 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_definition_4.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_definition_4.json @@ -1,22 +1 @@ -{ - "arguments": { - "argument_name": { - "name": "argument_name", - "is_required": true, - "is_array": false, - "description": "", - "default": null - } - }, - "options": { - "option_name": { - "name": "--option_name", - "shortcut": "-o", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "", - "default": false - } - } -} +{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_1.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_1.json index f86bf96..60c5b56 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_1.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_1.json @@ -1,9 +1 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": false, - "is_value_required": false, - "is_multiple": false, - "description": "", - "default": false -} +{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_2.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_2.json index 32dbab2..04e4228 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_2.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_2.json @@ -1,9 +1 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": false, - "is_multiple": false, - "description": "option description", - "default": "default_value" -} +{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":false,"description":"option description","default":"default_value"} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_3.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_3.json index 6d55a6e..c1ea120 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_3.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_3.json @@ -1,9 +1 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "option description", - "default": null -} +{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option description","default":null} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_4.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_4.json index 788a8ed..1b671d8 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_4.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_4.json @@ -1,9 +1 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": false, - "is_multiple": true, - "description": "option description", - "default": [] -} +{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":true,"description":"option description","default":[]} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_5.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_5.json index 9f34d83..35a1405 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_5.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_5.json @@ -1,9 +1 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "multiline option description", - "default": null -} +{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"multiline option description","default":null} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_5.txt b/application/vendor/symfony/console/Tests/Fixtures/input_option_5.txt index 9563b4c..4368883 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_5.txt +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_5.txt @@ -1,2 +1,2 @@ -o, --option_name=OPTION_NAME multiline - option description + option description diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_6.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_6.json index 0638de0..d84e872 100644 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_6.json +++ b/application/vendor/symfony/console/Tests/Fixtures/input_option_6.json @@ -1,9 +1 @@ -{ - "name": "--option_name", - "shortcut": "-o|-O", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "option with multiple shortcuts", - "default": null -} +{"name":"--option_name","shortcut":"-o|-O","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option with multiple shortcuts","default":null} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json deleted file mode 100644 index 7c96ad3..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": false, - "is_multiple": false, - "description": "option description", - "default": "INF" -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md deleted file mode 100644 index b57bd04..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: no -* Is multiple: no -* Description: option description -* Default: `INF` diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt deleted file mode 100644 index d467dcf..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name[=OPTION_NAME] option description [default: INF] diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml deleted file mode 100644 index 5d1d217..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json deleted file mode 100644 index df328bf..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": true, - "is_multiple": false, - "description": "option description", - "default": "style" -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md deleted file mode 100644 index 3f6dd23..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: yes -* Is multiple: no -* Description: option description -* Default: `'style'` diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt deleted file mode 100644 index 880a535..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name=OPTION_NAME option description [default: "\style\"] diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml deleted file mode 100644 index 764b9e6..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json deleted file mode 100644 index b175455..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "--option_name", - "shortcut": "-o", - "accept_value": true, - "is_value_required": true, - "is_multiple": true, - "description": "option description", - "default": [ - "Hello", - "world" - ] -} diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md deleted file mode 100644 index 24e58b5..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md +++ /dev/null @@ -1,9 +0,0 @@ -**option_name:** - -* Name: `--option_name` -* Shortcut: `-o` -* Accept value: yes -* Is value required: yes -* Is multiple: yes -* Description: option description -* Default: `array ( 0 => 'Hello', 1 => 'world',)` diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt deleted file mode 100644 index 265c18c..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt +++ /dev/null @@ -1 +0,0 @@ - -o, --option_name=OPTION_NAME option description [default: ["\Hello\","\world\"]] (multiple values allowed) diff --git a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml b/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml deleted file mode 100644 index 09dc865..0000000 --- a/application/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php b/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php index 6cd7c82..774df26 100644 --- a/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php +++ b/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Console\Tests\Formatter; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Formatter\OutputFormatterStyleStack; use Symfony\Component\Console\Formatter\OutputFormatterStyle; -class OutputFormatterStyleStackTest extends TestCase +class OutputFormatterStyleStackTest extends \PHPUnit_Framework_TestCase { public function testPush() { diff --git a/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php b/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php index ddf7790..0abfb3c 100644 --- a/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php +++ b/application/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php @@ -11,10 +11,9 @@ namespace Symfony\Component\Console\Tests\Formatter; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Formatter\OutputFormatterStyle; -class OutputFormatterStyleTest extends TestCase +class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -41,7 +40,7 @@ public function testForeground() $style->setForeground('default'); $this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo')); - $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException'); + $this->setExpectedException('InvalidArgumentException'); $style->setForeground('undefined-color'); } @@ -58,7 +57,7 @@ public function testBackground() $style->setBackground('default'); $this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo')); - $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException'); + $this->setExpectedException('InvalidArgumentException'); $style->setBackground('undefined-color'); } diff --git a/application/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php b/application/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php index 00e5231..b8d5ca6 100644 --- a/application/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php +++ b/application/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Console\Tests\Formatter; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatterStyle; -class OutputFormatterTest extends TestCase +class OutputFormatterTest extends \PHPUnit_Framework_TestCase { public function testEmptyTag() { @@ -28,9 +27,6 @@ public function testLGCharEscaping() $formatter = new OutputFormatter(true); $this->assertEquals('fooformat('foo\\assertEquals('foo << bar', $formatter->format('foo << bar')); - $this->assertEquals('foo << bar \\', $formatter->format('foo << bar \\')); - $this->assertEquals("foo << \033[32mbar \\ baz\033[39m \\", $formatter->format('foo << bar \\ baz \\')); $this->assertEquals('some info', $formatter->format('\\some info\\')); $this->assertEquals('\\some info\\', OutputFormatter::escape('some info')); @@ -199,9 +195,6 @@ public function testNotDecoratedFormatter() $this->assertEquals( 'some question', $formatter->format('some question') ); - $this->assertEquals( - 'some text with inline style', $formatter->format('some text with inline style') - ); $formatter->setDecorated(true); @@ -217,9 +210,6 @@ public function testNotDecoratedFormatter() $this->assertEquals( "\033[30;46msome question\033[39;49m", $formatter->format('some question') ); - $this->assertEquals( - "\033[31msome text with inline style\033[39m", $formatter->format('some text with inline style') - ); } public function testContentWithLineBreaks() diff --git a/application/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php b/application/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php index 746c2b4..e0aa921 100644 --- a/application/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php +++ b/application/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php @@ -11,10 +11,9 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\FormatterHelper; -class FormatterHelperTest extends TestCase +class FormatterHelperTest extends \PHPUnit_Framework_TestCase { public function testFormatSection() { @@ -53,9 +52,6 @@ public function testFormatBlock() ); } - /** - * @requires extension mbstring - */ public function testFormatBlockWithDiacriticLetters() { $formatter = new FormatterHelper(); @@ -69,9 +65,6 @@ public function testFormatBlockWithDiacriticLetters() ); } - /** - * @requires extension mbstring - */ public function testFormatBlockWithDoubleWidthDiacriticLetters() { $formatter = new FormatterHelper(); diff --git a/application/vendor/symfony/console/Tests/Helper/HelperSetTest.php b/application/vendor/symfony/console/Tests/Helper/HelperSetTest.php index 8f42cf9..04edd30 100644 --- a/application/vendor/symfony/console/Tests/Helper/HelperSetTest.php +++ b/application/vendor/symfony/console/Tests/Helper/HelperSetTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Command\Command; -class HelperSetTest extends TestCase +class HelperSetTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -64,10 +63,11 @@ public function testGet() $helperset = new HelperSet(); try { $helperset->get('foo'); - $this->fail('->get() throws \InvalidArgumentException when helper not found'); + $this->fail('->get() throws InvalidArgumentException when helper not found'); } catch (\Exception $e) { - $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws \InvalidArgumentException when helper not found'); - $this->assertContains('The helper "foo" is not defined.', $e->getMessage(), '->get() throws \InvalidArgumentException when helper not found'); + $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws InvalidArgumentException when helper not found'); + $this->assertInstanceOf('Symfony\Component\Console\Exception\ExceptionInterface', $e, '->get() throws domain specific exception when helper not found'); + $this->assertContains('The helper "foo" is not defined.', $e->getMessage(), '->get() throws InvalidArgumentException when helper not found'); } } @@ -108,9 +108,16 @@ public function testIteration() } } + /** + * Create a generic mock for the helper interface. Optionally check for a call to setHelperSet with a specific + * helperset instance. + * + * @param string $name + * @param HelperSet $helperset allows a mock to verify a particular helperset set is being added to the Helper + */ private function getGenericMockHelper($name, HelperSet $helperset = null) { - $mock_helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\HelperInterface')->getMock(); + $mock_helper = $this->getMock('\Symfony\Component\Console\Helper\HelperInterface'); $mock_helper->expects($this->any()) ->method('getName') ->will($this->returnValue($name)); diff --git a/application/vendor/symfony/console/Tests/Helper/HelperTest.php b/application/vendor/symfony/console/Tests/Helper/HelperTest.php index 1847582..33fa220 100644 --- a/application/vendor/symfony/console/Tests/Helper/HelperTest.php +++ b/application/vendor/symfony/console/Tests/Helper/HelperTest.php @@ -11,10 +11,9 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\Helper; -class HelperTest extends TestCase +class HelperTest extends \PHPUnit_Framework_TestCase { public function formatTimeProvider() { diff --git a/application/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php b/application/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php deleted file mode 100644 index b7d1b5c..0000000 --- a/application/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php +++ /dev/null @@ -1,258 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Helper\DialogHelper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @group legacy - */ -class LegacyDialogHelperTest extends TestCase -{ - public function testSelect() - { - $dialog = new DialogHelper(); - - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $heroes = array('Superman', 'Batman', 'Spiderman'); - - $dialog->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n")); - $this->assertEquals('2', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '2')); - $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); - $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); - $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', false)); - - rewind($output->getStream()); - $this->assertContains('Input "Fabien" is not a superhero!', stream_get_contents($output->getStream())); - - try { - $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, 1)); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals('Value "Fabien" is invalid', $e->getMessage()); - } - - $this->assertEquals(array('1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '0,1', false, 'Input "%s" is not a superhero!', true)); - $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, ' 0 , 1 ', false, 'Input "%s" is not a superhero!', true)); - } - - public function testSelectOnErrorOutput() - { - $dialog = new DialogHelper(); - - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $heroes = array('Superman', 'Batman', 'Spiderman'); - - $dialog->setInputStream($this->getInputStream("Stdout\n1\n")); - $this->assertEquals('1', $dialog->select($output = $this->getConsoleOutput($this->getOutputStream()), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', false)); - - rewind($output->getErrorOutput()->getStream()); - $this->assertContains('Input "Stdout" is not a superhero!', stream_get_contents($output->getErrorOutput()->getStream())); - } - - public function testAsk() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n8AM\n")); - - $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM')); - $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM')); - - rewind($output->getStream()); - $this->assertEquals('What time is it?', stream_get_contents($output->getStream())); - } - - public function testAskOnErrorOutput() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stderr` is required to test stderr output functionality'); - } - - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("not stdout\n")); - - $this->assertEquals('not stdout', $dialog->ask($output = $this->getConsoleOutput($this->getOutputStream()), 'Where should output go?', 'stderr')); - - rewind($output->getErrorOutput()->getStream()); - $this->assertEquals('Where should output go?', stream_get_contents($output->getErrorOutput()->getStream())); - } - - public function testAskWithAutocomplete() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - // Acm - // AcsTest - // - // - // Test - // - // S - // F00oo - $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n"); - - $dialog = new DialogHelper(); - $dialog->setInputStream($inputStream); - - $bundles = array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'); - - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AsseticBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FrameworkBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('SecurityBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FooBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('AsseticBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - $this->assertEquals('FooBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); - } - - /** - * @group tty - */ - public function testAskHiddenResponse() - { - if ('\\' === DIRECTORY_SEPARATOR) { - $this->markTestSkipped('This test is not supported on Windows'); - } - - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("8AM\n")); - - $this->assertEquals('8AM', $dialog->askHiddenResponse($this->getOutputStream(), 'What time is it?')); - } - - /** - * @group tty - */ - public function testAskHiddenResponseOnErrorOutput() - { - if ('\\' === DIRECTORY_SEPARATOR) { - $this->markTestSkipped('This test is not supported on Windows'); - } - - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("8AM\n")); - - $this->assertEquals('8AM', $dialog->askHiddenResponse($output = $this->getConsoleOutput($this->getOutputStream()), 'What time is it?')); - - rewind($output->getErrorOutput()->getStream()); - $this->assertContains('What time is it?', stream_get_contents($output->getErrorOutput()->getStream())); - } - - public function testAskConfirmation() - { - $dialog = new DialogHelper(); - - $dialog->setInputStream($this->getInputStream("\n\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?')); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("y\nyes\n")); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); - - $dialog->setInputStream($this->getInputStream("n\nno\n")); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); - } - - public function testAskAndValidate() - { - $dialog = new DialogHelper(); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = 'What color was the white horse of Henry IV?'; - $error = 'This is not a color!'; - $validator = function ($color) use ($error) { - if (!in_array($color, array('white', 'black'))) { - throw new \InvalidArgumentException($error); - } - - return $color; - }; - - $dialog->setInputStream($this->getInputStream("\nblack\n")); - $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); - - $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n")); - try { - $this->assertEquals('white', $dialog->askAndValidate($output = $this->getConsoleOutput($this->getOutputStream()), $question, $validator, 2, 'white')); - $this->fail(); - } catch (\InvalidArgumentException $e) { - $this->assertEquals($error, $e->getMessage()); - rewind($output->getErrorOutput()->getStream()); - $this->assertContains('What color was the white horse of Henry IV?', stream_get_contents($output->getErrorOutput()->getStream())); - } - } - - public function testNoInteraction() - { - $dialog = new DialogHelper(); - - $input = new ArrayInput(array()); - $input->setInteractive(false); - - $dialog->setInput($input); - - $this->assertEquals('not yet', $dialog->ask($this->getOutputStream(), 'Do you have a job?', 'not yet')); - } - - protected function getInputStream($input) - { - $stream = fopen('php://memory', 'r+', false); - fwrite($stream, $input); - rewind($stream); - - return $stream; - } - - protected function getOutputStream() - { - return new StreamOutput(fopen('php://memory', 'r+', false)); - } - - protected function getConsoleOutput($stderr) - { - $output = new ConsoleOutput(); - $output->setErrorOutput($stderr); - - return $output; - } - - private function hasSttyAvailable() - { - exec('stty 2>&1', $output, $exitcode); - - return 0 === $exitcode; - } -} diff --git a/application/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php b/application/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php deleted file mode 100644 index 76d003e..0000000 --- a/application/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php +++ /dev/null @@ -1,228 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Helper\ProgressHelper; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @group legacy - * @group time-sensitive - */ -class LegacyProgressHelperTest extends TestCase -{ - public function testAdvance() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 1 [->--------------------------]'), stream_get_contents($output->getStream())); - } - - public function testAdvanceWithStep() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(5); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); - } - - public function testAdvanceMultipleTimes() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->advance(3); - $progress->advance(2); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 3 [--->------------------------]').$this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream())); - } - - public function testCustomizations() - { - $progress = new ProgressHelper(); - $progress->setBarWidth(10); - $progress->setBarCharacter('_'); - $progress->setEmptyBarCharacter(' '); - $progress->setProgressCharacter('/'); - $progress->setFormat(' %current%/%max% [%bar%] %percent%%'); - $progress->start($output = $this->getOutputStream(), 10); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 1/10 [_/ ] 10%'), stream_get_contents($output->getStream())); - } - - public function testPercent() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%').$this->generateOutput(' 1/50 [>---------------------------] 2%').$this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream())); - } - - public function testOverwriteWithShorterLine() - { - $progress = new ProgressHelper(); - $progress->setFormat(' %current%/%max% [%bar%] %percent%%'); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - - // set shorter format - $progress->setFormat(' %current%/%max% [%bar%]'); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 2/50 [=>--------------------------] '), - stream_get_contents($output->getStream()) - ); - } - - public function testSetCurrentProgress() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->display(); - $progress->advance(); - $progress->setCurrent(15); - $progress->setCurrent(25); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%'). - $this->generateOutput(' 1/50 [>---------------------------] 2%'). - $this->generateOutput(' 15/50 [========>-------------------] 30%'). - $this->generateOutput(' 25/50 [==============>-------------] 50%'), - stream_get_contents($output->getStream()) - ); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You must start the progress bar - */ - public function testSetCurrentBeforeStarting() - { - $progress = new ProgressHelper(); - $progress->setCurrent(15); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage You can't regress the progress bar - */ - public function testRegressProgress() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->setCurrent(15); - $progress->setCurrent(10); - } - - public function testRedrawFrequency() - { - $progress = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressHelper')->setMethods(array('display'))->getMock(); - $progress->expects($this->exactly(4)) - ->method('display'); - - $progress->setRedrawFrequency(2); - - $progress->start($output = $this->getOutputStream(), 6); - $progress->setCurrent(1); - $progress->advance(2); - $progress->advance(2); - $progress->advance(1); - } - - /** - * @requires extension mbstring - */ - public function testMultiByteSupport() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream()); - $progress->setBarCharacter('■'); - $progress->advance(3); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 3 [■■■>------------------------]'), stream_get_contents($output->getStream())); - } - - public function testClear() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 50); - $progress->setCurrent(25); - $progress->clear(); - - rewind($output->getStream()); - $this->assertEquals( - $this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''), - stream_get_contents($output->getStream()) - ); - } - - public function testPercentNotHundredBeforeComplete() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(), 200); - $progress->display(); - $progress->advance(199); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%').$this->generateOutput(' 199/200 [===========================>] 99%').$this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream())); - } - - public function testNonDecoratedOutput() - { - $progress = new ProgressHelper(); - $progress->start($output = $this->getOutputStream(false)); - $progress->advance(); - - rewind($output->getStream()); - $this->assertEquals('', stream_get_contents($output->getStream())); - } - - protected function getOutputStream($decorated = true) - { - return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated); - } - - protected $lastMessagesLength; - - protected function generateOutput($expected) - { - $expectedout = $expected; - - if (null !== $this->lastMessagesLength) { - $expectedout = str_pad($expected, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT); - } - - $this->lastMessagesLength = strlen($expectedout); - - return "\x0D".$expectedout; - } -} diff --git a/application/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php b/application/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php deleted file mode 100644 index 9fdc1fb..0000000 --- a/application/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php +++ /dev/null @@ -1,323 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Helper\TableHelper; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @group legacy - */ -class LegacyTableHelperTest extends TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'r+'); - } - - protected function tearDown() - { - fclose($this->stream); - $this->stream = null; - } - - /** - * @dataProvider renderProvider - */ - public function testRender($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider renderProvider - */ - public function testRenderAddRows($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->addRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider renderProvider - */ - public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setLayout($layout) - ; - foreach ($rows as $row) { - $table->addRow($row); - } - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function renderProvider() - { - $books = array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ); - - return array( - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+--------------------------+------------------+ -| ISBN | Title | Author | -+---------------+--------------------------+------------------+ -| 99921-58-10-7 | Divine Comedy | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | -| 80-902734-1-6 | And Then There Were None | Agatha Christie | -+---------------+--------------------------+------------------+ - -TABLE - ), - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_COMPACT, -<<<'TABLE' - ISBN Title Author - 99921-58-10-7 Divine Comedy Dante Alighieri - 9971-5-0210-0 A Tale of Two Cities Charles Dickens - 960-425-059-0 The Lord of the Rings J. R. R. Tolkien - 80-902734-1-6 And Then There Were None Agatha Christie - -TABLE - ), - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_BORDERLESS, -<<<'TABLE' - =============== ========================== ================== - ISBN Title Author - =============== ========================== ================== - 99921-58-10-7 Divine Comedy Dante Alighieri - 9971-5-0210-0 A Tale of Two Cities Charles Dickens - 960-425-059-0 The Lord of the Rings J. R. R. Tolkien - 80-902734-1-6 And Then There Were None Agatha Christie - =============== ========================== ================== - -TABLE - ), - array( - array('ISBN', 'Title'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+--------------------------+------------------+ -| ISBN | Title | | -+---------------+--------------------------+------------------+ -| 99921-58-10-7 | Divine Comedy | Dante Alighieri | -| 9971-5-0210-0 | | | -| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | -| 80-902734-1-6 | And Then There Were None | Agatha Christie | -+---------------+--------------------------+------------------+ - -TABLE - ), - array( - array(), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+--------------------------+------------------+ -| 99921-58-10-7 | Divine Comedy | Dante Alighieri | -| 9971-5-0210-0 | | | -| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | -| 80-902734-1-6 | And Then There Were None | Agatha Christie | -+---------------+--------------------------+------------------+ - -TABLE - ), - array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', "Divine\nComedy", 'Dante Alighieri'), - array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), - array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), - array('960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+----------------------------+-----------------+ -| ISBN | Title | Author | -+---------------+----------------------------+-----------------+ -| 99921-58-10-7 | Divine | Dante Alighieri | -| | Comedy | | -| 9971-5-0210-2 | Harry Potter | Rowling | -| | and the Chamber of Secrets | Joanne K. | -| 9971-5-0210-2 | Harry Potter | Rowling | -| | and the Chamber of Secrets | Joanne K. | -| 960-425-059-0 | The Lord of the Rings | J. R. R. | -| | | Tolkien | -+---------------+----------------------------+-----------------+ - -TABLE - ), - array( - array('ISBN', 'Title'), - array(), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+------+-------+ -| ISBN | Title | -+------+-------+ - -TABLE - ), - array( - array(), - array(), - TableHelper::LAYOUT_DEFAULT, - '', - ), - 'Cell text with tags used for Output styling' => array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+----------------------+-----------------+ -| ISBN | Title | Author | -+---------------+----------------------+-----------------+ -| 99921-58-10-7 | Divine Comedy | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+---------------+----------------------+-----------------+ - -TABLE - ), - 'Cell text with tags not used for Output styling' => array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-700', 'Divine Com', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+----------------------------------+----------------------+-----------------+ -| ISBN | Title | Author | -+----------------------------------+----------------------+-----------------+ -| 99921-58-10-700 | Divine Com | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+----------------------------------+----------------------+-----------------+ - -TABLE - ), - ); - } - - /** - * @requires extension mbstring - */ - public function testRenderMultiByte() - { - $table = new TableHelper(); - $table - ->setHeaders(array('■■')) - ->setRows(array(array(1234))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = -<<<'TABLE' -+------+ -| ■■ | -+------+ -| 1234 | -+------+ - -TABLE; - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @requires extension mbstring - */ - public function testRenderFullWidthCharacters() - { - $table = new TableHelper(); - $table - ->setHeaders(array('あいうえお')) - ->setRows(array(array(1234567890))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = - <<<'TABLE' -+------------+ -| あいうえお | -+------------+ -| 1234567890 | -+------------+ - -TABLE; - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - protected function getOutputStream() - { - return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false); - } - - protected function getOutputContent(StreamOutput $output) - { - rewind($output->getStream()); - - return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream())); - } -} diff --git a/application/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php b/application/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php index 8069bcc..a51fb43 100644 --- a/application/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php +++ b/application/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php @@ -11,15 +11,13 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\DebugFormatterHelper; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Process\Process; -use Symfony\Component\Process\ProcessBuilder; -class ProcessHelperTest extends TestCase +class ProcessHelperTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider provideCommandsAndOutput @@ -48,35 +46,35 @@ public function testPassedCallbackIsExecuted() public function provideCommandsAndOutput() { - $successOutputVerbose = <<<'EOT' + $successOutputVerbose = <<42';" OUT 42 RES Command ran successfully EOT; - $successOutputProcessDebug = <<<'EOT' + $successOutputProcessDebug = <<getProcess()->getCommandLine(); - $successOutputProcessDebug = str_replace("'php' '-r' 'echo 42;'", $args, $successOutputProcessDebug); + if ('\\' === DIRECTORY_SEPARATOR) { + $successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug); + } return array( array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null), diff --git a/application/vendor/symfony/console/Tests/Helper/ProgressBarTest.php b/application/vendor/symfony/console/Tests/Helper/ProgressBarTest.php index d1616d1..db2325b 100644 --- a/application/vendor/symfony/console/Tests/Helper/ProgressBarTest.php +++ b/application/vendor/symfony/console/Tests/Helper/ProgressBarTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Output\StreamOutput; @@ -19,7 +18,7 @@ /** * @group time-sensitive */ -class ProgressBarTest extends TestCase +class ProgressBarTest extends \PHPUnit_Framework_TestCase { public function testMultipleStart() { @@ -274,6 +273,8 @@ public function testSetCurrentProgress() ); } + /** + */ public function testSetCurrentBeforeStarting() { $bar = new ProgressBar($this->getOutputStream()); @@ -295,7 +296,7 @@ public function testRegressProgress() public function testRedrawFrequency() { - $bar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')->setMethods(array('display'))->setConstructorArgs(array($this->getOutputStream(), 6))->getMock(); + $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream(), 6)); $bar->expects($this->exactly(4))->method('display'); $bar->setRedrawFrequency(2); @@ -308,7 +309,7 @@ public function testRedrawFrequency() public function testRedrawFrequencyIsAtLeastOneIfZeroGiven() { - $bar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')->setMethods(array('display'))->setConstructorArgs(array($this->getOutputStream()))->getMock(); + $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream())); $bar->expects($this->exactly(2))->method('display'); $bar->setRedrawFrequency(0); @@ -318,7 +319,7 @@ public function testRedrawFrequencyIsAtLeastOneIfZeroGiven() public function testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven() { - $bar = $this->getMockBuilder('Symfony\Component\Console\Helper\ProgressBar')->setMethods(array('display'))->setConstructorArgs(array($this->getOutputStream()))->getMock(); + $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream())); $bar->expects($this->exactly(2))->method('display'); $bar->setRedrawFrequency(0.9); @@ -326,9 +327,6 @@ public function testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven() $bar->advance(); } - /** - * @requires extension mbstring - */ public function testMultiByteSupport() { $bar = new ProgressBar($output = $this->getOutputStream()); @@ -560,9 +558,6 @@ public function testMultilineFormat() ); } - /** - * @requires extension mbstring - */ public function testAnsiColorsAndEmojis() { $bar = new ProgressBar($output = $this->getOutputStream(), 15); @@ -587,6 +582,7 @@ public function testAnsiColorsAndEmojis() rewind($output->getStream()); $this->assertEquals( + " \033[44;37m Starting the demo... fingers crossed \033[0m\n". ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n". " \xf0\x9f\x8f\x81 < 1 sec \033[44;37m 0 B \033[0m" diff --git a/application/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php b/application/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php new file mode 100644 index 0000000..1926252 --- /dev/null +++ b/application/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php @@ -0,0 +1,182 @@ +getOutputStream()); + $bar->start('Starting...'); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->setMessage('Advancing...'); + $bar->advance(); + $bar->finish('Done...'); + $bar->start('Starting Again...'); + usleep(101000); + $bar->advance(); + $bar->finish('Done Again...'); + + rewind($output->getStream()); + + $this->assertEquals( + $this->generateOutput(' - Starting...'). + $this->generateOutput(' \\ Starting...'). + $this->generateOutput(' | Starting...'). + $this->generateOutput(' / Starting...'). + $this->generateOutput(' - Starting...'). + $this->generateOutput(' \\ Starting...'). + $this->generateOutput(' \\ Advancing...'). + $this->generateOutput(' | Advancing...'). + $this->generateOutput(' | Done... '). + PHP_EOL. + $this->generateOutput(' - Starting Again...'). + $this->generateOutput(' \\ Starting Again...'). + $this->generateOutput(' \\ Done Again... '). + PHP_EOL, + stream_get_contents($output->getStream()) + ); + } + + public function testNonDecoratedOutput() + { + $bar = new ProgressIndicator($output = $this->getOutputStream(false)); + + $bar->start('Starting...'); + $bar->advance(); + $bar->advance(); + $bar->setMessage('Midway...'); + $bar->advance(); + $bar->advance(); + $bar->finish('Done...'); + + rewind($output->getStream()); + + $this->assertEquals( + ' Starting...'.PHP_EOL. + ' Midway... '.PHP_EOL. + ' Done... '.PHP_EOL.PHP_EOL, + stream_get_contents($output->getStream()) + ); + } + + public function testCustomIndicatorValues() + { + $bar = new ProgressIndicator($output = $this->getOutputStream(), null, 100, array('a', 'b', 'c')); + + $bar->start('Starting...'); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->advance(); + usleep(101000); + $bar->advance(); + + rewind($output->getStream()); + + $this->assertEquals( + $this->generateOutput(' a Starting...'). + $this->generateOutput(' b Starting...'). + $this->generateOutput(' c Starting...'). + $this->generateOutput(' a Starting...'), + stream_get_contents($output->getStream()) + ); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Must have at least 2 indicator value characters. + */ + public function testCannotSetInvalidIndicatorCharacters() + { + $bar = new ProgressIndicator($this->getOutputStream(), null, 100, array('1')); + } + + /** + * @expectedException \LogicException + * @expectedExceptionMessage Progress indicator already started. + */ + public function testCannotStartAlreadyStartedIndicator() + { + $bar = new ProgressIndicator($this->getOutputStream()); + $bar->start('Starting...'); + $bar->start('Starting Again.'); + } + + /** + * @expectedException \LogicException + * @expectedExceptionMessage Progress indicator has not yet been started. + */ + public function testCannotAdvanceUnstartedIndicator() + { + $bar = new ProgressIndicator($this->getOutputStream()); + $bar->advance(); + } + + /** + * @expectedException \LogicException + * @expectedExceptionMessage Progress indicator has not yet been started. + */ + public function testCannotFinishUnstartedIndicator() + { + $bar = new ProgressIndicator($this->getOutputStream()); + $bar->finish('Finished'); + } + + /** + * @dataProvider provideFormat + */ + public function testFormats($format) + { + $bar = new ProgressIndicator($output = $this->getOutputStream(), $format); + $bar->start('Starting...'); + $bar->advance(); + + rewind($output->getStream()); + + $this->assertNotEmpty(stream_get_contents($output->getStream())); + } + + /** + * Provides each defined format. + * + * @return array + */ + public function provideFormat() + { + return array( + array('normal'), + array('verbose'), + array('very_verbose'), + array('debug'), + ); + } + + protected function getOutputStream($decorated = true, $verbosity = StreamOutput::VERBOSITY_NORMAL) + { + return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated); + } + + protected function generateOutput($expected) + { + $count = substr_count($expected, "\n"); + + return "\x0D".($count ? sprintf("\033[%dA", $count) : '').$expected; + } +} diff --git a/application/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php b/application/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php index 9f837d0..6a4f8ac 100644 --- a/application/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php +++ b/application/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Helper\HelperSet; @@ -24,7 +23,7 @@ /** * @group tty */ -class QuestionHelperTest extends TestCase +class QuestionHelperTest extends \PHPUnit_Framework_TestCase { public function testAskChoice() { @@ -84,10 +83,6 @@ public function testAskChoice() $question->setMultiselect(true); $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - - $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 0); - // We are supposed to get the default value since we are not in interactive mode - $this->assertEquals('Superman', $questionHelper->ask($this->createInputInterfaceMock(true), $this->createOutputInterface(), $question)); } public function testAsk() @@ -160,70 +155,6 @@ public function testAskWithAutocompleteWithNonSequentialKeys() $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); } - public function testAskWithAutocompleteWithExactMatch() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - $inputStream = $this->getInputStream("b\n"); - - $possibleChoices = array( - 'a' => 'berlin', - 'b' => 'copenhagen', - 'c' => 'amsterdam', - ); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($inputStream); - $dialog->setHelperSet(new HelperSet(array(new FormatterHelper()))); - - $question = new ChoiceQuestion('Please select a city', $possibleChoices); - $question->setMaxAttempts(1); - - $this->assertSame('b', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - - public function testAutocompleteWithTrailingBackslash() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - $inputStream = $this->getInputStream('E'); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($inputStream); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new Question(''); - $expectedCompletion = 'ExampleNamespace\\'; - $question->setAutocompleterValues(array($expectedCompletion)); - - $output = $this->createOutputInterface(); - $dialog->ask($this->createInputInterfaceMock(), $output, $question); - - $outputStream = $output->getStream(); - rewind($outputStream); - $actualOutput = stream_get_contents($outputStream); - - // Shell control (esc) sequences are not so important: we only care that - // tag is interpreted correctly and replaced - $irrelevantEscSequences = array( - "\0337" => '', // Save cursor position - "\0338" => '', // Restore cursor position - "\033[K" => '', // Clear line from cursor till the end - ); - - $importantActualOutput = strtr($actualOutput, $irrelevantEscSequences); - - // Remove colors (e.g. "\033[30m", "\033[31;41m") - $importantActualOutput = preg_replace('/\033\[\d+(;\d+)?m/', '', $importantActualOutput); - - $this->assertEquals($expectedCompletion, $importantActualOutput); - } - public function testAskHiddenResponse() { if ('\\' === DIRECTORY_SEPARATOR) { @@ -341,37 +272,6 @@ public function simpleAnswerProvider() ); } - /** - * @dataProvider specialCharacterInMultipleChoice - */ - public function testSpecialCharacterChoiceFromMultipleChoiceList($providedAnswer, $expectedValue) - { - $possibleChoices = array( - '.', - 'src', - ); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream($providedAnswer."\n")); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new ChoiceQuestion('Please select the directory', $possibleChoices); - $question->setMaxAttempts(1); - $question->setMultiselect(true); - $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - - $this->assertSame($expectedValue, $answer); - } - - public function specialCharacterInMultipleChoice() - { - return array( - array('.', array('.')), - array('., src', array('.', 'src')), - ); - } - /** * @dataProvider mixedKeysChoiceListAnswerProvider */ @@ -488,7 +388,7 @@ public function testChoiceOutputFormattingQuestionForUtf8Keys() ' [żółw ] bar', ' [łabądź] baz', ); - $output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock(); + $output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface'); $output->method('getFormatter')->willReturn(new OutputFormatter()); $dialog = new QuestionHelper(); @@ -502,80 +402,6 @@ public function testChoiceOutputFormattingQuestionForUtf8Keys() $dialog->ask($this->createInputInterfaceMock(), $output, $question); } - /** - * @expectedException \Symfony\Component\Console\Exception\RuntimeException - * @expectedExceptionMessage Aborted - */ - public function testAskThrowsExceptionOnMissingInput() - { - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream('')); - - $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), new Question('What\'s your name?')); - } - - /** - * @expectedException \Symfony\Component\Console\Exception\RuntimeException - * @expectedExceptionMessage Aborted - */ - public function testAskThrowsExceptionOnMissingInputWithValidator() - { - $dialog = new QuestionHelper(); - $dialog->setInputStream($this->getInputStream('')); - - $question = new Question('What\'s your name?'); - $question->setValidator(function () { - if (!$value) { - throw new \Exception('A value is required.'); - } - }); - - $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question); - } - - /** - * @expectedException \LogicException - * @expectedExceptionMessage Choice question must have at least 1 choice available. - */ - public function testEmptyChoices() - { - new ChoiceQuestion('Question', array(), 'irrelevant'); - } - - public function testTraversableAutocomplete() - { - if (!$this->hasSttyAvailable()) { - $this->markTestSkipped('`stty` is required to test autocomplete functionality'); - } - - // Acm - // AcsTest - // - // - // Test - // - // S - // F00oo - $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n"); - - $dialog = new QuestionHelper(); - $dialog->setInputStream($inputStream); - $helperSet = new HelperSet(array(new FormatterHelper())); - $dialog->setHelperSet($helperSet); - - $question = new Question('Please select a bundle', 'FrameworkBundle'); - $question->setAutocompleterValues(new AutocompleteValues(array('irrelevant' => 'AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'))); - - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('FrameworkBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('SecurityBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('FooBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - $this->assertEquals('FooBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - protected function getInputStream($input) { $stream = fopen('php://memory', 'r+', false); @@ -592,7 +418,7 @@ protected function createOutputInterface() protected function createInputInterfaceMock($interactive = true) { - $mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock(); + $mock = $this->getMock('Symfony\Component\Console\Input\InputInterface'); $mock->expects($this->any()) ->method('isInteractive') ->will($this->returnValue($interactive)); @@ -604,21 +430,6 @@ private function hasSttyAvailable() { exec('stty 2>&1', $output, $exitcode); - return 0 === $exitcode; - } -} - -class AutocompleteValues implements \IteratorAggregate -{ - private $values; - - public function __construct(array $values) - { - $this->values = $values; - } - - public function getIterator() - { - return new \ArrayIterator($this->values); + return $exitcode === 0; } } diff --git a/application/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php b/application/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php index 1a2d1b8..032e153 100644 --- a/application/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php +++ b/application/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php @@ -2,18 +2,16 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\FormatterHelper; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\SymfonyQuestionHelper; use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Question\ChoiceQuestion; /** * @group tty */ -class SymfonyQuestionHelperTest extends TestCase +class SymfonyQuestionHelperTest extends \PHPUnit_Framework_TestCase { public function testAskChoice() { @@ -75,54 +73,6 @@ public function testAskChoice() $this->assertOutputContains('What is your favorite superhero? [Superman, Batman]', $output); } - public function testAskReturnsNullIfValidatorAllowsIt() - { - $questionHelper = new SymfonyQuestionHelper(); - $questionHelper->setInputStream($this->getInputStream("\n")); - $question = new Question('What is your favorite superhero?'); - $question->setValidator(function ($value) { return $value; }); - $this->assertNull($questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question)); - } - - public function testAskEscapeDefaultValue() - { - $helper = new SymfonyQuestionHelper(); - $helper->setInputStream($this->getInputStream('\\')); - $helper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), new Question('Can I have a backslash?', '\\')); - - $this->assertOutputContains('Can I have a backslash? [\]', $output); - } - - public function testAskEscapeAndFormatLabel() - { - $helper = new SymfonyQuestionHelper(); - $helper->setInputStream($this->getInputStream('Foo\\Bar')); - $helper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), new Question('Do you want to use Foo\\Bar or Foo\\Baz\\?', 'Foo\\Baz')); - - $this->assertOutputContains('Do you want to use Foo\\Bar or Foo\\Baz\\? [Foo\\Baz]:', $output); - } - - public function testLabelTrailingBackslash() - { - $helper = new SymfonyQuestionHelper(); - $helper->setInputStream($this->getInputStream('sure')); - $helper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), new Question('Question with a trailing \\')); - - $this->assertOutputContains('Question with a trailing \\', $output); - } - - /** - * @expectedException \Symfony\Component\Console\Exception\RuntimeException - * @expectedExceptionMessage Aborted - */ - public function testAskThrowsExceptionOnMissingInput() - { - $dialog = new SymfonyQuestionHelper(); - - $dialog->setInputStream($this->getInputStream('')); - $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), new Question('What\'s your name?')); - } - protected function getInputStream($input) { $stream = fopen('php://memory', 'r+', false); @@ -142,7 +92,7 @@ protected function createOutputInterface() protected function createInputInterfaceMock($interactive = true) { - $mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock(); + $mock = $this->getMock('Symfony\Component\Console\Input\InputInterface'); $mock->expects($this->any()) ->method('isInteractive') ->will($this->returnValue($interactive)); diff --git a/application/vendor/symfony/console/Tests/Helper/TableStyleTest.php b/application/vendor/symfony/console/Tests/Helper/TableStyleTest.php index 13e918b..587d841 100644 --- a/application/vendor/symfony/console/Tests/Helper/TableStyleTest.php +++ b/application/vendor/symfony/console/Tests/Helper/TableStyleTest.php @@ -11,10 +11,9 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\TableStyle; -class TableStyleTest extends TestCase +class TableStyleTest extends \PHPUnit_Framework_TestCase { /** * @expectedException \InvalidArgumentException diff --git a/application/vendor/symfony/console/Tests/Helper/TableTest.php b/application/vendor/symfony/console/Tests/Helper/TableTest.php index 0e98432..c318232 100644 --- a/application/vendor/symfony/console/Tests/Helper/TableTest.php +++ b/application/vendor/symfony/console/Tests/Helper/TableTest.php @@ -11,14 +11,13 @@ namespace Symfony\Component\Console\Tests\Helper; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Helper\TableStyle; use Symfony\Component\Console\Helper\TableSeparator; use Symfony\Component\Console\Helper\TableCell; use Symfony\Component\Console\Output\StreamOutput; -class TableTest extends TestCase +class TableTest extends \PHPUnit_Framework_TestCase { protected $stream; @@ -34,11 +33,11 @@ protected function tearDown() } /** - * @dataProvider renderProvider + * @dataProvider testRenderProvider */ - public function testRender($headers, $rows, $style, $expected, $decorated = false) + public function testRender($headers, $rows, $style, $expected) { - $table = new Table($output = $this->getOutputStream($decorated)); + $table = new Table($output = $this->getOutputStream()); $table ->setHeaders($headers) ->setRows($rows) @@ -50,11 +49,11 @@ public function testRender($headers, $rows, $style, $expected, $decorated = fals } /** - * @dataProvider renderProvider + * @dataProvider testRenderProvider */ - public function testRenderAddRows($headers, $rows, $style, $expected, $decorated = false) + public function testRenderAddRows($headers, $rows, $style, $expected) { - $table = new Table($output = $this->getOutputStream($decorated)); + $table = new Table($output = $this->getOutputStream()); $table ->setHeaders($headers) ->addRows($rows) @@ -66,11 +65,11 @@ public function testRenderAddRows($headers, $rows, $style, $expected, $decorated } /** - * @dataProvider renderProvider + * @dataProvider testRenderProvider */ - public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $decorated = false) + public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected) { - $table = new Table($output = $this->getOutputStream($decorated)); + $table = new Table($output = $this->getOutputStream()); $table ->setHeaders($headers) ->setStyle($style) @@ -83,7 +82,7 @@ public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $d $this->assertEquals($expected, $this->getOutputContent($output)); } - public function renderProvider() + public function testRenderProvider() { $books = array( array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), @@ -97,7 +96,7 @@ public function renderProvider() array('ISBN', 'Title', 'Author'), $books, 'default', -<<<'TABLE' +<<Charles Dickens'), ), 'default', -<<<'TABLE' +<<
    3)), - new TableCell('Divine Comedy', array('rowspan' => 2)), + 'Divine Comedy', 'Dante Alighieri', ), - array(), + array('A Tale of Two Cities', 'Charles Dickens'), array("The Lord of \nthe Rings", "J. R. \nR. Tolkien"), new TableSeparator(), array('80-902734-1-6', new TableCell("And Then \nThere \nWere None", array('rowspan' => 3)), 'Agatha Christie'), array('80-902734-1-7', 'Test'), ), 'default', -<<<'TABLE' -+---------------+---------------+-----------------+ -| ISBN | Title | Author | -+---------------+---------------+-----------------+ -| 9971-5-0210-0 | Divine Comedy | Dante Alighieri | -| | | | -| | The Lord of | J. R. | -| | the Rings | R. Tolkien | -+---------------+---------------+-----------------+ -| 80-902734-1-6 | And Then | Agatha Christie | -| 80-902734-1-7 | There | Test | -| | Were None | | -+---------------+---------------+-----------------+ +<<
    array( - array( - new TableCell('Long Title', array('colspan' => 3)), - ), - array( - array( - new TableCell('9971-5-0210-0', array('colspan' => 3)), - ), - new TableSeparator(), - array( - 'Dante Alighieri', - 'J. R. R. Tolkien', - 'J. R. R', - ), - ), - 'default', - <<
    array( - array(), - array( - array( - new TableCell('Dont break'."\n".'here', array('colspan' => 2)), - ), - new TableSeparator(), - array( - 'foo', - new TableCell('Dont break'."\n".'here', array('rowspan' => 2)), - ), - array( - 'bar', - ), - ), - 'default', - <<<'TABLE' -+-------+------------+ -| Dont break | -| here | -+-------+------------+ -| foo | Dont break | -| bar | here | -+-------+------------+ - -TABLE - , - true, - ), ); } - /** - * @requires extension mbstring - */ public function testRenderMultiByte() { $table = new Table($output = $this->getOutputStream()); @@ -561,49 +499,13 @@ public function testRenderMultiByte() $table->render(); $expected = -<<<'TABLE' +<<
    assertEquals($expected, $this->getOutputContent($output)); - } - - public function testTableCellWithNumericIntValue() - { - $table = new Table($output = $this->getOutputStream()); - - $table->setRows(array(array(new TableCell(12345)))); - $table->render(); - - $expected = -<<<'TABLE' -+-------+ -| 12345 | -+-------+ - -TABLE; - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function testTableCellWithNumericFloatValue() - { - $table = new Table($output = $this->getOutputStream()); - - $table->setRows(array(array(new TableCell(12345.01)))); - $table->render(); - - $expected = -<<<'TABLE' -+----------+ -| 12345.01 | -+----------+ - TABLE; $this->assertEquals($expected, $this->getOutputContent($output)); @@ -627,7 +529,7 @@ public function testStyle() $table->render(); $expected = -<<<'TABLE' +<<
    render(); $expected = -<<<'TABLE' +<<
    assertEquals($table, $table->addRow(new TableSeparator()), 'fluent interface on addRow() with a single TableSeparator() works'); } + public function testRenderMultiCalls() + { + $table = new Table($output = $this->getOutputStream()); + $table->setRows(array( + array(new TableCell('foo', array('colspan' => 2))), + )); + $table->render(); + $table->render(); + $table->render(); + + $expected = +<<
    assertEquals($expected, $this->getOutputContent($output)); + } + + public function testColumnStyle() + { + $table = new Table($output = $this->getOutputStream()); + $table + ->setHeaders(array('ISBN', 'Title', 'Author', 'Price')) + ->setRows(array( + array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'), + array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25'), + )); + + $style = new TableStyle(); + $style->setPadType(STR_PAD_LEFT); + $table->setColumnStyle(3, $style); + + $table->render(); + + $expected = + <<
    assertEquals($expected, $this->getOutputContent($output)); + } + /** - * @expectedException \InvalidArgumentException + * @expectedException Symfony\Component\Console\Exception\InvalidArgumentException * @expectedExceptionMessage Style "absent" is not defined. */ public function testIsNotDefinedStyleException() @@ -683,7 +642,7 @@ public function testIsNotDefinedStyleException() } /** - * @expectedException \InvalidArgumentException + * @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException * @expectedExceptionMessage Style "absent" is not defined. */ public function testGetStyleDefinition() @@ -691,9 +650,9 @@ public function testGetStyleDefinition() Table::getStyleDefinition('absent'); } - protected function getOutputStream($decorated = false) + protected function getOutputStream() { - return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated); + return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false); } protected function getOutputContent(StreamOutput $output) diff --git a/application/vendor/symfony/console/Tests/Input/ArgvInputTest.php b/application/vendor/symfony/console/Tests/Input/ArgvInputTest.php index 5f813ee..0a568a7 100644 --- a/application/vendor/symfony/console/Tests/Input/ArgvInputTest.php +++ b/application/vendor/symfony/console/Tests/Input/ArgvInputTest.php @@ -11,13 +11,12 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -class ArgvInputTest extends TestCase +class ArgvInputTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -72,18 +71,6 @@ public function provideOptions() array('foo' => 'bar'), '->parse() parses long options with a required value (with a space separator)', ), - array( - array('cli.php', '--foo='), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)), - array('foo' => null), - '->parse() parses long options with optional value which is empty (with a = separator) as null', - ), - array( - array('cli.php', '--foo=', 'bar'), - array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)), - array('foo' => null), - '->parse() parses long options with optional value which is empty (with a = separator) followed by an argument', - ), array( array('cli.php', '-f'), array(new InputOption('foo', 'f')), @@ -164,12 +151,7 @@ public function provideOptions() */ public function testInvalidInput($argv, $definition, $expectedExceptionMessage) { - if (method_exists($this, 'expectException')) { - $this->expectException('RuntimeException'); - $this->expectExceptionMessage($expectedExceptionMessage); - } else { - $this->setExpectedException('RuntimeException', $expectedExceptionMessage); - } + $this->setExpectedException('RuntimeException', $expectedExceptionMessage); $input = new ArgvInput($argv); $input->bind($definition); @@ -296,10 +278,6 @@ public function testHasParameterOption() $input = new ArgvInput(array('cli.php', '-f', 'foo')); $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input'); - $input = new ArgvInput(array('cli.php', '-etest')); - $this->assertTrue($input->hasParameterOption('-e'), '->hasParameterOption() returns true if the given short option is in the raw input'); - $this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input'); - $input = new ArgvInput(array('cli.php', '--foo', 'foo')); $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input'); @@ -310,44 +288,19 @@ public function testHasParameterOption() $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given option with provided value is in the raw input'); } - public function testHasParameterOptionEdgeCasesAndLimitations() + public function testHasParameterOptionOnlyOptions() { - $input = new ArgvInput(array('cli.php', '-fh')); - // hasParameterOption does not know if the previous short option, -f, - // takes a value or not. If -f takes a value, then -fh does NOT include - // -h; Otherwise it does. Since we do not know which short options take - // values, hasParameterOption does not support this use-case. - $this->assertFalse($input->hasParameterOption('-h'), '->hasParameterOption() returns true if the given short option is in the raw input'); - // hasParameterOption does detect that `-fh` contains `-f`, since - // `-f` is the first short option in the set. - $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input'); - // The test below happens to pass, although it might make more sense - // to disallow it, and require the use of - // $input->hasParameterOption('-f') && $input->hasParameterOption('-h') - // instead. - $this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input'); - // In theory, if -fh is supported, then -hf should also work. - // However, this is not supported. - $this->assertFalse($input->hasParameterOption('-hf'), '->hasParameterOption() returns true if the given short option is in the raw input'); - - $input = new ArgvInput(array('cli.php', '-f', '-h')); - // If hasParameterOption('-fh') is supported for 'cli.php -fh', then - // one might also expect that it should also be supported for - // 'cli.php -f -h'. However, this is not supported. - $this->assertFalse($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input'); - } + $input = new ArgvInput(array('cli.php', '-f', 'foo')); + $this->assertTrue($input->hasParameterOption('-f', true), '->hasParameterOption() returns true if the given short option is in the raw input'); - public function testNoWarningOnInvalidParameterOption() - { - $input = new ArgvInput(array('cli.php', '-edev')); + $input = new ArgvInput(array('cli.php', '--foo', '--', 'foo')); + $this->assertTrue($input->hasParameterOption('--foo', true), '->hasParameterOption() returns true if the given long option is in the raw input'); - $this->assertTrue($input->hasParameterOption(array('-e', ''))); - // No warning thrown - $this->assertFalse($input->hasParameterOption(array('-m', ''))); + $input = new ArgvInput(array('cli.php', '--foo=bar', 'foo')); + $this->assertTrue($input->hasParameterOption('--foo', true), '->hasParameterOption() returns true if the given long option with provided value is in the raw input'); - $this->assertEquals('dev', $input->getParameterOption(array('-e', ''))); - // No warning thrown - $this->assertFalse($input->getParameterOption(array('-m', ''))); + $input = new ArgvInput(array('cli.php', '--', '--foo')); + $this->assertFalse($input->hasParameterOption('--foo', true), '->hasParameterOption() returns false if the given option is in the raw input but after an end of options signal'); } public function testToString() @@ -362,22 +315,25 @@ public function testToString() /** * @dataProvider provideGetParameterOptionValues */ - public function testGetParameterOptionEqualSign($argv, $key, $expected) + public function testGetParameterOptionEqualSign($argv, $key, $onlyParams, $expected) { $input = new ArgvInput($argv); - $this->assertEquals($expected, $input->getParameterOption($key), '->getParameterOption() returns the expected value'); + $this->assertEquals($expected, $input->getParameterOption($key, false, $onlyParams), '->getParameterOption() returns the expected value'); } public function provideGetParameterOptionValues() { return array( - array(array('app/console', 'foo:bar', '-edev'), '-e', 'dev'), - array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'dev'), - array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'), - array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'), - array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), '1'), - array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), '1'), + array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', false, 'dev'), + array(array('app/console', 'foo:bar', '--env=dev'), '--env', false, 'dev'), + array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), false, 'dev'), + array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), false, 'dev'), + array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), false, '1'), + array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), false, '1'), + array(array('app/console', 'foo:bar', '--env', 'val'), '--env', false, 'val'), + array(array('app/console', 'foo:bar', '--env', 'val', '--dummy'), '--env', false, 'val'), + array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', false, 'dev'), + array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', true, false), ); } @@ -387,30 +343,4 @@ public function testParseSingleDashAsArgument() $input->bind(new InputDefinition(array(new InputArgument('file')))); $this->assertEquals(array('file' => '-'), $input->getArguments(), '->parse() parses single dash as an argument'); } - - public function testParseOptionWithValueOptionalGivenEmptyAndRequiredArgument() - { - $input = new ArgvInput(array('cli.php', '--foo=', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)))); - $this->assertEquals(array('foo' => null), $input->getOptions(), '->parse() parses optional options with empty value as null'); - $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses required arguments'); - - $input = new ArgvInput(array('cli.php', '--foo=0', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)))); - $this->assertEquals(array('foo' => '0'), $input->getOptions(), '->parse() parses optional options with empty value as null'); - $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses required arguments'); - } - - public function testParseOptionWithValueOptionalGivenEmptyAndOptionalArgument() - { - $input = new ArgvInput(array('cli.php', '--foo=', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::OPTIONAL)))); - $this->assertEquals(array('foo' => null), $input->getOptions(), '->parse() parses optional options with empty value as null'); - $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses optional arguments'); - - $input = new ArgvInput(array('cli.php', '--foo=0', 'bar')); - $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::OPTIONAL)))); - $this->assertEquals(array('foo' => '0'), $input->getOptions(), '->parse() parses optional options with empty value as null'); - $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses optional arguments'); - } } diff --git a/application/vendor/symfony/console/Tests/Input/ArrayInputTest.php b/application/vendor/symfony/console/Tests/Input/ArrayInputTest.php index b998172..afb9913 100644 --- a/application/vendor/symfony/console/Tests/Input/ArrayInputTest.php +++ b/application/vendor/symfony/console/Tests/Input/ArrayInputTest.php @@ -11,13 +11,12 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -class ArrayInputTest extends TestCase +class ArrayInputTest extends \PHPUnit_Framework_TestCase { public function testGetFirstArgument() { @@ -37,15 +36,24 @@ public function testHasParameterOption() $input = new ArrayInput(array('--foo')); $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters'); + + $input = new ArrayInput(array('--foo', '--', '--bar')); + $this->assertTrue($input->hasParameterOption('--bar'), '->hasParameterOption() returns true if an option is present in the passed parameters'); + $this->assertFalse($input->hasParameterOption('--bar', true), '->hasParameterOption() returns false if an option is present in the passed parameters after an end of options signal'); } public function testGetParameterOption() { $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar')); $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name'); + $this->assertFalse($input->getParameterOption('--bar'), '->getParameterOption() returns the default if an option is not present in the passed parameters'); $input = new ArrayInput(array('Fabien', '--foo' => 'bar')); $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name'); + + $input = new ArrayInput(array('--foo', '--', '--bar' => 'woop')); + $this->assertEquals('woop', $input->getParameterOption('--bar'), '->getParameterOption() returns the correct value if an option is present in the passed parameters'); + $this->assertFalse($input->getParameterOption('--bar', false, true), '->getParameterOption() returns false if an option is present in the passed parameters after an end of options signal'); } public function testParseArguments() @@ -92,6 +100,18 @@ public function provideOptions() array('foo' => 'bar'), '->parse() parses short options', ), + array( + array('--' => null, '-f' => 'bar'), + array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')), + array('foo' => 'default'), + '->parse() does not parse opts after an end of options signal', + ), + array( + array('--' => null), + array(), + array(), + '->parse() does not choke on end of options signal', + ), ); } @@ -100,12 +120,7 @@ public function provideOptions() */ public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage) { - if (method_exists($this, 'expectException')) { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage($expectedExceptionMessage); - } else { - $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); - } + $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage); new ArrayInput($parameters, $definition); } @@ -140,11 +155,5 @@ public function testToString() { $input = new ArrayInput(array('-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C")); $this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input); - - $input = new ArrayInput(array('-b' => array('bval_1', 'bval_2'), '--f' => array('fval_1', 'fval_2'))); - $this->assertSame('-b=bval_1 -b=bval_2 --f=fval_1 --f=fval_2', (string) $input); - - $input = new ArrayInput(array('array_arg' => array('val_1', 'val_2'))); - $this->assertSame('val_1 val_2', (string) $input); } } diff --git a/application/vendor/symfony/console/Tests/Input/InputArgumentTest.php b/application/vendor/symfony/console/Tests/Input/InputArgumentTest.php index 66af98b..cfb37cd 100644 --- a/application/vendor/symfony/console/Tests/Input/InputArgumentTest.php +++ b/application/vendor/symfony/console/Tests/Input/InputArgumentTest.php @@ -11,10 +11,9 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputArgument; -class InputArgumentTest extends TestCase +class InputArgumentTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -42,12 +41,7 @@ public function testModes() */ public function testInvalidModes($mode) { - if (method_exists($this, 'expectException')) { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage(sprintf('Argument mode "%s" is not valid.', $mode)); - } else { - $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode)); - } + $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode)); new InputArgument('foo', $mode); } diff --git a/application/vendor/symfony/console/Tests/Input/InputDefinitionTest.php b/application/vendor/symfony/console/Tests/Input/InputDefinitionTest.php index b19708e..739e107 100644 --- a/application/vendor/symfony/console/Tests/Input/InputDefinitionTest.php +++ b/application/vendor/symfony/console/Tests/Input/InputDefinitionTest.php @@ -11,12 +11,11 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -class InputDefinitionTest extends TestCase +class InputDefinitionTest extends \PHPUnit_Framework_TestCase { protected static $fixtures; @@ -387,41 +386,6 @@ public function testGetShortSynopsis() $this->assertEquals('[options] [--] []', $definition->getSynopsis(true), '->getSynopsis(true) groups options in [options]'); } - /** - * @group legacy - */ - public function testLegacyAsText() - { - $definition = new InputDefinition(array( - new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), - new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), - new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('http://foo.com/')), - new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'), - new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), - new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), - new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('http://foo.com/', 'bar')), - new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')), - )); - - $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); - } - - /** - * @group legacy - */ - public function testLegacyAsXml() - { - $definition = new InputDefinition(array( - new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), - new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), - new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('bar')), - new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'), - new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), - new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), - )); - $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition'); - } - protected function initializeArguments() { $this->foo = new InputArgument('foo'); diff --git a/application/vendor/symfony/console/Tests/Input/InputOptionTest.php b/application/vendor/symfony/console/Tests/Input/InputOptionTest.php index 943bf60..53ce1df 100644 --- a/application/vendor/symfony/console/Tests/Input/InputOptionTest.php +++ b/application/vendor/symfony/console/Tests/Input/InputOptionTest.php @@ -11,10 +11,9 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputOption; -class InputOptionTest extends TestCase +class InputOptionTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -78,12 +77,7 @@ public function testModes() */ public function testInvalidModes($mode) { - if (method_exists($this, 'expectException')) { - $this->expectException('InvalidArgumentException'); - $this->expectExceptionMessage(sprintf('Option mode "%s" is not valid.', $mode)); - } else { - $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode)); - } + $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode)); new InputOption('foo', 'f', $mode); } diff --git a/application/vendor/symfony/console/Tests/Input/InputTest.php b/application/vendor/symfony/console/Tests/Input/InputTest.php index 42abd82..eb1c661 100644 --- a/application/vendor/symfony/console/Tests/Input/InputTest.php +++ b/application/vendor/symfony/console/Tests/Input/InputTest.php @@ -11,13 +11,12 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -class InputTest extends TestCase +class InputTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { diff --git a/application/vendor/symfony/console/Tests/Input/StringInputTest.php b/application/vendor/symfony/console/Tests/Input/StringInputTest.php index 839af73..7059cf0 100644 --- a/application/vendor/symfony/console/Tests/Input/StringInputTest.php +++ b/application/vendor/symfony/console/Tests/Input/StringInputTest.php @@ -11,12 +11,11 @@ namespace Symfony\Component\Console\Tests\Input; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\StringInput; -class StringInputTest extends TestCase +class StringInputTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider getTokenizeData @@ -42,19 +41,6 @@ public function testInputOptionWithGivenString() $this->assertEquals('bar', $input->getOption('foo')); } - /** - * @group legacy - */ - public function testLegacyInputOptionDefinitionInConstructor() - { - $definition = new InputDefinition( - array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) - ); - - $input = new StringInput('--foo=bar', $definition); - $this->assertEquals('bar', $input->getOption('foo')); - } - public function getTokenizeData() { return array( diff --git a/application/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php b/application/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php index dac911b..c5eca2c 100644 --- a/application/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php +++ b/application/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php @@ -11,8 +11,7 @@ namespace Symfony\Component\Console\Tests\Logger; -use PHPUnit\Framework\TestCase; -use Psr\Log\LoggerInterface; +use Psr\Log\Test\LoggerInterfaceTest; use Psr\Log\LogLevel; use Symfony\Component\Console\Logger\ConsoleLogger; use Symfony\Component\Console\Tests\Fixtures\DummyOutput; @@ -22,9 +21,8 @@ * Console logger test. * * @author Kévin Dunglas - * @author Jordi Boggiano */ -class ConsoleLoggerTest extends TestCase +class ConsoleLoggerTest extends LoggerInterfaceTest { /** * @var DummyOutput @@ -32,7 +30,7 @@ class ConsoleLoggerTest extends TestCase protected $output; /** - * @return LoggerInterface + * {@inheritdoc} */ public function getLogger() { @@ -51,121 +49,10 @@ public function getLogger() } /** - * Return the log messages in order. - * - * @return string[] + * {@inheritdoc} */ public function getLogs() { return $this->output->getLogs(); } - - public function testImplements() - { - $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); - } - - /** - * @dataProvider provideLevelsAndMessages - */ - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - - $expected = array( - $level.' message of level '.$level.' with context: Bob', - $level.' message of level '.$level.' with context: Bob', - ); - $this->assertEquals($expected, $this->getLogs()); - } - - public function provideLevelsAndMessages() - { - return array( - LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), - LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), - LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), - LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), - LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), - LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), - LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), - LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), - ); - } - - /** - * @expectedException \Psr\Log\InvalidArgumentException - */ - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testObjectCastToString() - { - if (method_exists($this, 'createPartialMock')) { - $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', array('__toString')); - } else { - $dummy = $this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest', array('__toString')); - } - $dummy->expects($this->once()) - ->method('__toString') - ->will($this->returnValue('DUMMY')); - - $this->getLogger()->warning($dummy); - - $expected = array('warning DUMMY'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextCanContainAnything() - { - $context = array( - 'bool' => true, - 'null' => null, - 'string' => 'Foo', - 'int' => 0, - 'float' => 0.5, - 'nested' => array('with object' => new DummyTest()), - 'object' => new \DateTime(), - 'resource' => fopen('php://memory', 'r'), - ); - - $this->getLogger()->warning('Crazy context data', $context); - - $expected = array('warning Crazy context data'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $logger = $this->getLogger(); - $logger->warning('Random message', array('exception' => 'oops')); - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - - $expected = array( - 'warning Random message', - 'critical Uncaught Exception!', - ); - $this->assertEquals($expected, $this->getLogs()); - } -} - -class DummyTest -{ - public function __toString() - { - } } diff --git a/application/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php b/application/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php index db39a02..1afbbb6 100644 --- a/application/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php +++ b/application/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php @@ -11,12 +11,10 @@ namespace Symfony\Component\Console\Tests\Output; -use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\Output; -class ConsoleOutputTest extends TestCase +class ConsoleOutputTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -24,19 +22,4 @@ public function testConstructor() $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument'); $this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument'); } - - public function testSetFormatter() - { - $output = new ConsoleOutput(); - $outputFormatter = new OutputFormatter(); - $output->setFormatter($outputFormatter); - $this->assertSame($outputFormatter, $output->getFormatter()); - } - - public function testSetVerbosity() - { - $output = new ConsoleOutput(); - $output->setVerbosity(Output::VERBOSITY_VERBOSE); - $this->assertSame(Output::VERBOSITY_VERBOSE, $output->getVerbosity()); - } } diff --git a/application/vendor/symfony/console/Tests/Output/NullOutputTest.php b/application/vendor/symfony/console/Tests/Output/NullOutputTest.php index b7ff4be..b20ae4e 100644 --- a/application/vendor/symfony/console/Tests/Output/NullOutputTest.php +++ b/application/vendor/symfony/console/Tests/Output/NullOutputTest.php @@ -11,13 +11,10 @@ namespace Symfony\Component\Console\Tests\Output; -use PHPUnit\Framework\TestCase; -use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Output\NullOutput; -use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\OutputInterface; -class NullOutputTest extends TestCase +class NullOutputTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -39,50 +36,4 @@ public function testVerbosity() $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput'); } - - public function testSetFormatter() - { - $output = new NullOutput(); - $outputFormatter = new OutputFormatter(); - $output->setFormatter($outputFormatter); - $this->assertNotSame($outputFormatter, $output->getFormatter()); - } - - public function testSetVerbosity() - { - $output = new NullOutput(); - $output->setVerbosity(Output::VERBOSITY_NORMAL); - $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity()); - } - - public function testSetDecorated() - { - $output = new NullOutput(); - $output->setDecorated(true); - $this->assertFalse($output->isDecorated()); - } - - public function testIsQuiet() - { - $output = new NullOutput(); - $this->assertTrue($output->isQuiet()); - } - - public function testIsVerbose() - { - $output = new NullOutput(); - $this->assertFalse($output->isVerbose()); - } - - public function testIsVeryVerbose() - { - $output = new NullOutput(); - $this->assertFalse($output->isVeryVerbose()); - } - - public function testIsDebug() - { - $output = new NullOutput(); - $this->assertFalse($output->isDebug()); - } } diff --git a/application/vendor/symfony/console/Tests/Output/OutputTest.php b/application/vendor/symfony/console/Tests/Output/OutputTest.php index f122c07..45e6ddc 100644 --- a/application/vendor/symfony/console/Tests/Output/OutputTest.php +++ b/application/vendor/symfony/console/Tests/Output/OutputTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Console\Tests\Output; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Formatter\OutputFormatterStyle; -class OutputTest extends TestCase +class OutputTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { @@ -117,16 +116,6 @@ public function testWriteDecoratedMessage() $this->assertEquals("\033[33;41;5mfoo\033[39;49;25m\n", $output->output, '->writeln() decorates the output'); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unknown output type given (24) - */ - public function testWriteWithInvalidOutputType() - { - $output = new TestOutput(); - $output->writeln('foo', 24); - } - public function testWriteWithInvalidStyle() { $output = new TestOutput(); @@ -139,6 +128,35 @@ public function testWriteWithInvalidStyle() $output->writeln('foo'); $this->assertEquals("foo\n", $output->output, '->writeln() do nothing when a style does not exist'); } + + /** + * @dataProvider verbosityProvider + */ + public function testWriteWithVerbosityOption($verbosity, $expected, $msg) + { + $output = new TestOutput(); + + $output->setVerbosity($verbosity); + $output->clear(); + $output->write('1', false); + $output->write('2', false, Output::VERBOSITY_QUIET); + $output->write('3', false, Output::VERBOSITY_NORMAL); + $output->write('4', false, Output::VERBOSITY_VERBOSE); + $output->write('5', false, Output::VERBOSITY_VERY_VERBOSE); + $output->write('6', false, Output::VERBOSITY_DEBUG); + $this->assertEquals($expected, $output->output, $msg); + } + + public function verbosityProvider() + { + return array( + array(Output::VERBOSITY_QUIET, '2', '->write() in QUIET mode only outputs when an explicit QUIET verbosity is passed'), + array(Output::VERBOSITY_NORMAL, '123', '->write() in NORMAL mode outputs anything below an explicit VERBOSE verbosity'), + array(Output::VERBOSITY_VERBOSE, '1234', '->write() in VERBOSE mode outputs anything below an explicit VERY_VERBOSE verbosity'), + array(Output::VERBOSITY_VERY_VERBOSE, '12345', '->write() in VERY_VERBOSE mode outputs anything below an explicit DEBUG verbosity'), + array(Output::VERBOSITY_DEBUG, '123456', '->write() in DEBUG mode outputs everything'), + ); + } } class TestOutput extends Output diff --git a/application/vendor/symfony/console/Tests/Output/StreamOutputTest.php b/application/vendor/symfony/console/Tests/Output/StreamOutputTest.php index 780b568..2fd4f61 100644 --- a/application/vendor/symfony/console/Tests/Output/StreamOutputTest.php +++ b/application/vendor/symfony/console/Tests/Output/StreamOutputTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Console\Tests\Output; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\StreamOutput; -class StreamOutputTest extends TestCase +class StreamOutputTest extends \PHPUnit_Framework_TestCase { protected $stream; diff --git a/application/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php b/application/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php index ee9b09f..e4ce037 100644 --- a/application/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php +++ b/application/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php @@ -11,14 +11,14 @@ namespace Symfony\Component\Console\Tests\Style; -use PHPUnit\Framework\TestCase; +use PHPUnit_Framework_TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Console\Tester\CommandTester; -class SymfonyStyleTest extends TestCase +class SymfonyStyleTest extends PHPUnit_Framework_TestCase { /** @var Command */ protected $command; diff --git a/application/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php b/application/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php index 57e7136..a8389dd 100644 --- a/application/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php +++ b/application/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php @@ -11,12 +11,11 @@ namespace Symfony\Component\Console\Tests\Tester; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Tester\ApplicationTester; -class ApplicationTesterTest extends TestCase +class ApplicationTesterTest extends \PHPUnit_Framework_TestCase { protected $application; protected $tester; diff --git a/application/vendor/symfony/console/Tests/Tester/CommandTesterTest.php b/application/vendor/symfony/console/Tests/Tester/CommandTesterTest.php index 8d4e05a..b54c00e 100644 --- a/application/vendor/symfony/console/Tests/Tester/CommandTesterTest.php +++ b/application/vendor/symfony/console/Tests/Tester/CommandTesterTest.php @@ -11,13 +11,12 @@ namespace Symfony\Component\Console\Tests\Tester; -use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Tester\CommandTester; -class CommandTesterTest extends TestCase +class CommandTesterTest extends \PHPUnit_Framework_TestCase { protected $command; protected $tester; diff --git a/application/vendor/symfony/console/composer.json b/application/vendor/symfony/console/composer.json index 9f63559..1a316e4 100644 --- a/application/vendor/symfony/console/composer.json +++ b/application/vendor/symfony/console/composer.json @@ -16,18 +16,18 @@ } ], "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0", "psr/log": "~1.0" }, "suggest": { "symfony/event-dispatcher": "", "symfony/process": "", - "psr/log-implementation": "For using the console logger" + "psr/log": "For using the console logger" }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" }, @@ -38,7 +38,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } } } diff --git a/application/vendor/symfony/console/phpunit.xml.dist b/application/vendor/symfony/console/phpunit.xml.dist index 7e7ff5b..8c09554 100644 --- a/application/vendor/symfony/console/phpunit.xml.dist +++ b/application/vendor/symfony/console/phpunit.xml.dist @@ -5,8 +5,6 @@ backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" - failOnRisky="true" - failOnWarning="true" > @@ -28,4 +26,14 @@ + + + + + + Symfony\Component\Console + + + + diff --git a/application/vendor/symfony/css-selector/CssSelector.php b/application/vendor/symfony/css-selector/CssSelector.php deleted file mode 100644 index c1f8c88..0000000 --- a/application/vendor/symfony/css-selector/CssSelector.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector; - -@trigger_error('The '.__NAMESPACE__.'\CssSelector class is deprecated since Symfony 2.8 and will be removed in 3.0. Use directly the \Symfony\Component\CssSelector\CssSelectorConverter class instead.', E_USER_DEPRECATED); - -/** - * CssSelector is the main entry point of the component and can convert CSS - * selectors to XPath expressions. - * - * $xpath = CssSelector::toXpath('h1.foo'); - * - * This component is a port of the Python cssselect library, - * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. - * - * Copyright (c) 2007-2012 Ian Bicking and contributors. See AUTHORS - * for more details. - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. Neither the name of Ian Bicking nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IAN BICKING OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @author Fabien Potencier - * - * @deprecated as of 2.8, will be removed in 3.0. Use the \Symfony\Component\CssSelector\CssSelectorConverter class instead. - */ -class CssSelector -{ - private static $html = true; - - /** - * Translates a CSS expression to its XPath equivalent. - * Optionally, a prefix can be added to the resulting XPath - * expression with the $prefix parameter. - * - * @param mixed $cssExpr The CSS expression - * @param string $prefix An optional prefix for the XPath expression - * - * @return string - */ - public static function toXPath($cssExpr, $prefix = 'descendant-or-self::') - { - $converter = new CssSelectorConverter(self::$html); - - return $converter->toXPath($cssExpr, $prefix); - } - - /** - * Enables the HTML extension. - */ - public static function enableHtmlExtension() - { - self::$html = true; - } - - /** - * Disables the HTML extension. - */ - public static function disableHtmlExtension() - { - self::$html = false; - } -} diff --git a/application/vendor/symfony/css-selector/Exception/SyntaxErrorException.php b/application/vendor/symfony/css-selector/Exception/SyntaxErrorException.php index cb3158a..1200c97 100644 --- a/application/vendor/symfony/css-selector/Exception/SyntaxErrorException.php +++ b/application/vendor/symfony/css-selector/Exception/SyntaxErrorException.php @@ -25,7 +25,6 @@ class SyntaxErrorException extends ParseException { /** * @param string $expectedValue - * @param Token $foundToken * * @return self */ diff --git a/application/vendor/symfony/css-selector/LICENSE b/application/vendor/symfony/css-selector/LICENSE index 21d7fb9..9e936ec 100644 --- a/application/vendor/symfony/css-selector/LICENSE +++ b/application/vendor/symfony/css-selector/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2020 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/application/vendor/symfony/css-selector/Node/AbstractNode.php b/application/vendor/symfony/css-selector/Node/AbstractNode.php index 1d5d8ff..de2e74a 100644 --- a/application/vendor/symfony/css-selector/Node/AbstractNode.php +++ b/application/vendor/symfony/css-selector/Node/AbstractNode.php @@ -34,7 +34,7 @@ abstract class AbstractNode implements NodeInterface public function getNodeName() { if (null === $this->nodeName) { - $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', \get_called_class()); + $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); } return $this->nodeName; diff --git a/application/vendor/symfony/css-selector/Node/AttributeNode.php b/application/vendor/symfony/css-selector/Node/AttributeNode.php index 1caccb6..c09d924 100644 --- a/application/vendor/symfony/css-selector/Node/AttributeNode.php +++ b/application/vendor/symfony/css-selector/Node/AttributeNode.php @@ -30,11 +30,10 @@ class AttributeNode extends AbstractNode private $value; /** - * @param NodeInterface $selector - * @param string $namespace - * @param string $attribute - * @param string $operator - * @param string $value + * @param string $namespace + * @param string $attribute + * @param string $operator + * @param string $value */ public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value) { diff --git a/application/vendor/symfony/css-selector/Node/ClassNode.php b/application/vendor/symfony/css-selector/Node/ClassNode.php index 69462e8..866607c 100644 --- a/application/vendor/symfony/css-selector/Node/ClassNode.php +++ b/application/vendor/symfony/css-selector/Node/ClassNode.php @@ -27,8 +27,7 @@ class ClassNode extends AbstractNode private $name; /** - * @param NodeInterface $selector - * @param string $name + * @param string $name */ public function __construct(NodeInterface $selector, $name) { diff --git a/application/vendor/symfony/css-selector/Node/CombinedSelectorNode.php b/application/vendor/symfony/css-selector/Node/CombinedSelectorNode.php index 2aa583a..27b0224 100644 --- a/application/vendor/symfony/css-selector/Node/CombinedSelectorNode.php +++ b/application/vendor/symfony/css-selector/Node/CombinedSelectorNode.php @@ -28,9 +28,7 @@ class CombinedSelectorNode extends AbstractNode private $subSelector; /** - * @param NodeInterface $selector - * @param string $combinator - * @param NodeInterface $subSelector + * @param string $combinator */ public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector) { diff --git a/application/vendor/symfony/css-selector/Node/FunctionNode.php b/application/vendor/symfony/css-selector/Node/FunctionNode.php index 5026825..b6f95e9 100644 --- a/application/vendor/symfony/css-selector/Node/FunctionNode.php +++ b/application/vendor/symfony/css-selector/Node/FunctionNode.php @@ -30,11 +30,10 @@ class FunctionNode extends AbstractNode private $arguments; /** - * @param NodeInterface $selector - * @param string $name - * @param Token[] $arguments + * @param string $name + * @param Token[] $arguments */ - public function __construct(NodeInterface $selector, $name, array $arguments = array()) + public function __construct(NodeInterface $selector, $name, array $arguments = []) { $this->selector = $selector; $this->name = strtolower($name); diff --git a/application/vendor/symfony/css-selector/Node/HashNode.php b/application/vendor/symfony/css-selector/Node/HashNode.php index ebf9a98..3ea89dc 100644 --- a/application/vendor/symfony/css-selector/Node/HashNode.php +++ b/application/vendor/symfony/css-selector/Node/HashNode.php @@ -27,8 +27,7 @@ class HashNode extends AbstractNode private $id; /** - * @param NodeInterface $selector - * @param string $id + * @param string $id */ public function __construct(NodeInterface $selector, $id) { diff --git a/application/vendor/symfony/css-selector/Node/PseudoNode.php b/application/vendor/symfony/css-selector/Node/PseudoNode.php index 3842c69..c7d0b9f 100644 --- a/application/vendor/symfony/css-selector/Node/PseudoNode.php +++ b/application/vendor/symfony/css-selector/Node/PseudoNode.php @@ -27,8 +27,7 @@ class PseudoNode extends AbstractNode private $identifier; /** - * @param NodeInterface $selector - * @param string $identifier + * @param string $identifier */ public function __construct(NodeInterface $selector, $identifier) { diff --git a/application/vendor/symfony/css-selector/Node/SelectorNode.php b/application/vendor/symfony/css-selector/Node/SelectorNode.php index 057107f..2379bab 100644 --- a/application/vendor/symfony/css-selector/Node/SelectorNode.php +++ b/application/vendor/symfony/css-selector/Node/SelectorNode.php @@ -27,8 +27,7 @@ class SelectorNode extends AbstractNode private $pseudoElement; /** - * @param NodeInterface $tree - * @param string|null $pseudoElement + * @param string|null $pseudoElement */ public function __construct(NodeInterface $tree, $pseudoElement = null) { diff --git a/application/vendor/symfony/css-selector/Node/Specificity.php b/application/vendor/symfony/css-selector/Node/Specificity.php index 6aa70d7..a11b7f7 100644 --- a/application/vendor/symfony/css-selector/Node/Specificity.php +++ b/application/vendor/symfony/css-selector/Node/Specificity.php @@ -48,7 +48,7 @@ public function __construct($a, $b, $c) /** * @return self */ - public function plus(Specificity $specificity) + public function plus(self $specificity) { return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c); } @@ -69,7 +69,7 @@ public function getValue() * * @return int */ - public function compareTo(Specificity $specificity) + public function compareTo(self $specificity) { if ($this->a !== $specificity->a) { return $this->a > $specificity->a ? 1 : -1; diff --git a/application/vendor/symfony/css-selector/Parser/Handler/StringHandler.php b/application/vendor/symfony/css-selector/Parser/Handler/StringHandler.php index 00155b0..72e94c3 100644 --- a/application/vendor/symfony/css-selector/Parser/Handler/StringHandler.php +++ b/application/vendor/symfony/css-selector/Parser/Handler/StringHandler.php @@ -47,7 +47,7 @@ public function handle(Reader $reader, TokenStream $stream) { $quote = $reader->getSubstring(1); - if (!\in_array($quote, array("'", '"'))) { + if (!\in_array($quote, ["'", '"'])) { return false; } @@ -55,7 +55,7 @@ public function handle(Reader $reader, TokenStream $stream) $match = $reader->findPattern($this->patterns->getQuotedStringPattern($quote)); if (!$match) { - throw new InternalErrorException(sprintf('Should have found at least an empty match at %s.', $reader->getPosition())); + throw new InternalErrorException(sprintf('Should have found at least an empty match at %d.', $reader->getPosition())); } // check unclosed strings diff --git a/application/vendor/symfony/css-selector/Parser/Parser.php b/application/vendor/symfony/css-selector/Parser/Parser.php index 87c05a7..7b131ef 100644 --- a/application/vendor/symfony/css-selector/Parser/Parser.php +++ b/application/vendor/symfony/css-selector/Parser/Parser.php @@ -76,22 +76,22 @@ public static function parseSeries(array $tokens) switch (true) { case 'odd' === $joined: - return array(2, 1); + return [2, 1]; case 'even' === $joined: - return array(2, 0); + return [2, 0]; case 'n' === $joined: - return array(1, 0); + return [1, 0]; case false === strpos($joined, 'n'): - return array(0, $int($joined)); + return [0, $int($joined)]; } $split = explode('n', $joined); $first = isset($split[0]) ? $split[0] : null; - return array( + return [ $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1, isset($split[1]) && $split[1] ? $int($split[1]) : 0, - ); + ]; } /** @@ -102,12 +102,12 @@ public static function parseSeries(array $tokens) private function parseSelectorList(TokenStream $stream) { $stream->skipWhitespace(); - $selectors = array(); + $selectors = []; while (true) { $selectors[] = $this->parserSelectorNode($stream); - if ($stream->getPeek()->isDelimiter(array(','))) { + if ($stream->getPeek()->isDelimiter([','])) { $stream->getNext(); $stream->skipWhitespace(); } else { @@ -133,7 +133,7 @@ private function parserSelectorNode(TokenStream $stream) $stream->skipWhitespace(); $peek = $stream->getPeek(); - if ($peek->isFileEnd() || $peek->isDelimiter(array(','))) { + if ($peek->isFileEnd() || $peek->isDelimiter([','])) { break; } @@ -141,7 +141,7 @@ private function parserSelectorNode(TokenStream $stream) throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector'); } - if ($peek->isDelimiter(array('+', '>', '~'))) { + if ($peek->isDelimiter(['+', '>', '~'])) { $combinator = $stream->getNext()->getValue(); $stream->skipWhitespace(); } else { @@ -158,8 +158,7 @@ private function parserSelectorNode(TokenStream $stream) /** * Parses next simple node (hash, class, pseudo, negation). * - * @param TokenStream $stream - * @param bool $insideNegation + * @param bool $insideNegation * * @return array * @@ -177,8 +176,8 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals $peek = $stream->getPeek(); if ($peek->isWhitespace() || $peek->isFileEnd() - || $peek->isDelimiter(array(',', '+', '>', '~')) - || ($insideNegation && $peek->isDelimiter(array(')'))) + || $peek->isDelimiter([',', '+', '>', '~']) + || ($insideNegation && $peek->isDelimiter([')'])) ) { break; } @@ -189,16 +188,16 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals if ($peek->isHash()) { $result = new Node\HashNode($result, $stream->getNext()->getValue()); - } elseif ($peek->isDelimiter(array('.'))) { + } elseif ($peek->isDelimiter(['.'])) { $stream->getNext(); $result = new Node\ClassNode($result, $stream->getNextIdentifier()); - } elseif ($peek->isDelimiter(array('['))) { + } elseif ($peek->isDelimiter(['['])) { $stream->getNext(); $result = $this->parseAttributeNode($result, $stream); - } elseif ($peek->isDelimiter(array(':'))) { + } elseif ($peek->isDelimiter([':'])) { $stream->getNext(); - if ($stream->getPeek()->isDelimiter(array(':'))) { + if ($stream->getPeek()->isDelimiter([':'])) { $stream->getNext(); $pseudoElement = $stream->getNextIdentifier(); @@ -206,7 +205,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals } $identifier = $stream->getNextIdentifier(); - if (\in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) { + if (\in_array(strtolower($identifier), ['first-line', 'first-letter', 'before', 'after'])) { // Special case: CSS 2.1 pseudo-elements can have a single ':'. // Any new pseudo-element must have two. $pseudoElement = $identifier; @@ -214,7 +213,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals continue; } - if (!$stream->getPeek()->isDelimiter(array('('))) { + if (!$stream->getPeek()->isDelimiter(['('])) { $result = new Node\PseudoNode($result, $identifier); continue; @@ -235,13 +234,13 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals throw SyntaxErrorException::pseudoElementFound($argumentPseudoElement, 'inside ::not()'); } - if (!$next->isDelimiter(array(')'))) { + if (!$next->isDelimiter([')'])) { throw SyntaxErrorException::unexpectedToken('")"', $next); } $result = new Node\NegationNode($result, $argument); } else { - $arguments = array(); + $arguments = []; $next = null; while (true) { @@ -251,10 +250,10 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals if ($next->isIdentifier() || $next->isString() || $next->isNumber() - || $next->isDelimiter(array('+', '-')) + || $next->isDelimiter(['+', '-']) ) { $arguments[] = $next; - } elseif ($next->isDelimiter(array(')'))) { + } elseif ($next->isDelimiter([')'])) { break; } else { throw SyntaxErrorException::unexpectedToken('an argument', $next); @@ -276,7 +275,7 @@ private function parseSimpleSelector(TokenStream $stream, $insideNegation = fals throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek()); } - return array($result, $pseudoElement); + return [$result, $pseudoElement]; } /** @@ -288,7 +287,7 @@ private function parseElementNode(TokenStream $stream) { $peek = $stream->getPeek(); - if ($peek->isIdentifier() || $peek->isDelimiter(array('*'))) { + if ($peek->isIdentifier() || $peek->isDelimiter(['*'])) { if ($peek->isIdentifier()) { $namespace = $stream->getNext()->getValue(); } else { @@ -296,7 +295,7 @@ private function parseElementNode(TokenStream $stream) $namespace = null; } - if ($stream->getPeek()->isDelimiter(array('|'))) { + if ($stream->getPeek()->isDelimiter(['|'])) { $stream->getNext(); $element = $stream->getNextIdentifierOrStar(); } else { @@ -322,14 +321,14 @@ private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $s $stream->skipWhitespace(); $attribute = $stream->getNextIdentifierOrStar(); - if (null === $attribute && !$stream->getPeek()->isDelimiter(array('|'))) { + if (null === $attribute && !$stream->getPeek()->isDelimiter(['|'])) { throw SyntaxErrorException::unexpectedToken('"|"', $stream->getPeek()); } - if ($stream->getPeek()->isDelimiter(array('|'))) { + if ($stream->getPeek()->isDelimiter(['|'])) { $stream->getNext(); - if ($stream->getPeek()->isDelimiter(array('='))) { + if ($stream->getPeek()->isDelimiter(['='])) { $namespace = null; $stream->getNext(); $operator = '|='; @@ -346,12 +345,12 @@ private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $s $stream->skipWhitespace(); $next = $stream->getNext(); - if ($next->isDelimiter(array(']'))) { + if ($next->isDelimiter([']'])) { return new Node\AttributeNode($selector, $namespace, $attribute, 'exists', null); - } elseif ($next->isDelimiter(array('='))) { + } elseif ($next->isDelimiter(['='])) { $operator = '='; - } elseif ($next->isDelimiter(array('^', '$', '*', '~', '|', '!')) - && $stream->getPeek()->isDelimiter(array('=')) + } elseif ($next->isDelimiter(['^', '$', '*', '~', '|', '!']) + && $stream->getPeek()->isDelimiter(['=']) ) { $operator = $next->getValue().'='; $stream->getNext(); @@ -375,7 +374,7 @@ private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $s $stream->skipWhitespace(); $next = $stream->getNext(); - if (!$next->isDelimiter(array(']'))) { + if (!$next->isDelimiter([']'])) { throw SyntaxErrorException::unexpectedToken('"]"', $next); } diff --git a/application/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php b/application/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php index c513de5..3b92006 100644 --- a/application/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php +++ b/application/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php @@ -41,11 +41,11 @@ public function parse($source) // 2 => string 'input' (length=5) // 3 => string 'ab6bd_field' (length=11) if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+\.([\w-]++)$/i', trim($source), $matches)) { - return array( + return [ new SelectorNode(new ClassNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])), - ); + ]; } - return array(); + return []; } } diff --git a/application/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php b/application/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php index c29f5e4..392c6aa 100644 --- a/application/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php +++ b/application/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php @@ -39,9 +39,9 @@ public function parse($source) // 1 => string 'testns' (length=6) // 2 => string 'testel' (length=6) if (preg_match('/^(?:([a-z]++)\|)?([\w-]++|\*)$/i', trim($source), $matches)) { - return array(new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2]))); + return [new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2]))]; } - return array(); + return []; } } diff --git a/application/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php b/application/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php index 16d374a..276b574 100644 --- a/application/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php +++ b/application/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php @@ -38,9 +38,9 @@ public function parse($source) { // Matches an empty string if ('' == $source) { - return array(new SelectorNode(new ElementNode(null, '*'))); + return [new SelectorNode(new ElementNode(null, '*'))]; } - return array(); + return []; } } diff --git a/application/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php b/application/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php index 3f3883b..0ffcb6d 100644 --- a/application/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php +++ b/application/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php @@ -41,11 +41,11 @@ public function parse($source) // 2 => string 'input' (length=5) // 3 => string 'ab6bd_field' (length=11) if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+#([\w-]++)$/i', trim($source), $matches)) { - return array( + return [ new SelectorNode(new HashNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])), - ); + ]; } - return array(); + return []; } } diff --git a/application/vendor/symfony/css-selector/Parser/Token.php b/application/vendor/symfony/css-selector/Parser/Token.php index 72baae7..d641da8 100644 --- a/application/vendor/symfony/css-selector/Parser/Token.php +++ b/application/vendor/symfony/css-selector/Parser/Token.php @@ -82,7 +82,7 @@ public function isFileEnd() /** * @return bool */ - public function isDelimiter(array $values = array()) + public function isDelimiter(array $values = []) { if (self::TYPE_DELIMITER !== $this->type) { return false; diff --git a/application/vendor/symfony/css-selector/Parser/TokenStream.php b/application/vendor/symfony/css-selector/Parser/TokenStream.php index d2aee54..001bfe1 100644 --- a/application/vendor/symfony/css-selector/Parser/TokenStream.php +++ b/application/vendor/symfony/css-selector/Parser/TokenStream.php @@ -29,12 +29,12 @@ class TokenStream /** * @var Token[] */ - private $tokens = array(); + private $tokens = []; /** * @var Token[] */ - private $used = array(); + private $used = []; /** * @var int @@ -154,8 +154,8 @@ public function getNextIdentifierOrStar() return $next->getValue(); } - if ($next->isDelimiter(array('*'))) { - return; + if ($next->isDelimiter(['*'])) { + return null; } throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next); diff --git a/application/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php b/application/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php index e32b4d2..fc65bc6 100644 --- a/application/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php +++ b/application/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php @@ -38,14 +38,14 @@ public function __construct() $patterns = new TokenizerPatterns(); $escaping = new TokenizerEscaping($patterns); - $this->handlers = array( + $this->handlers = [ new Handler\WhitespaceHandler(), new Handler\IdentifierHandler($patterns, $escaping), new Handler\HashHandler($patterns, $escaping), new Handler\StringHandler($patterns, $escaping), new Handler\NumberHandler($patterns), new Handler\CommentHandler(), - ); + ]; } /** diff --git a/application/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php b/application/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php index 55ea421..ce322e9 100644 --- a/application/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php +++ b/application/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php @@ -73,6 +73,8 @@ private function replaceUnicodeSequences($value) if (0x10000 > $c) { return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F); } + + return ''; }, $value); } } diff --git a/application/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php b/application/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php index a3eea7a..82e527c 100644 --- a/application/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php +++ b/application/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php @@ -35,12 +35,10 @@ public function testCssToXPathXml() $this->assertEquals('descendant-or-self::H1', $converter->toXPath('H1')); } - /** - * @expectedException \Symfony\Component\CssSelector\Exception\ParseException - * @expectedExceptionMessage Expected identifier, but found. - */ public function testParseExceptions() { + $this->expectException('Symfony\Component\CssSelector\Exception\ParseException'); + $this->expectExceptionMessage('Expected identifier, but found.'); $converter = new CssSelectorConverter(); $converter->toXPath('h1:'); } @@ -55,22 +53,22 @@ public function testCssToXPathWithoutPrefix($css, $xpath) public function getCssToXPathWithoutPrefixTestData() { - return array( - array('h1', 'h1'), - array('foo|h1', 'foo:h1'), - array('h1, h2, h3', 'h1 | h2 | h3'), - array('h1:nth-child(3n+1)', "*/*[(name() = 'h1') and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"), - array('h1 > p', 'h1/p'), - array('h1#foo', "h1[@id = 'foo']"), - array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"), - array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"), - array('h1[class]', 'h1[@class]'), - array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"), - array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"), - array('div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - ); + return [ + ['h1', 'h1'], + ['foo|h1', 'foo:h1'], + ['h1, h2, h3', 'h1 | h2 | h3'], + ['h1:nth-child(3n+1)', "*/*[(name() = 'h1') and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"], + ['h1 > p', 'h1/p'], + ['h1#foo', "h1[@id = 'foo']"], + ['h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ['h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"], + ['h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"], + ['h1[class]', 'h1[@class]'], + ['h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ['h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"], + ['h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"], + ['div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ['div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/CssSelectorTest.php b/application/vendor/symfony/css-selector/Tests/CssSelectorTest.php deleted file mode 100644 index f8ba536..0000000 --- a/application/vendor/symfony/css-selector/Tests/CssSelectorTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\CssSelector\Tests; - -use PHPUnit\Framework\TestCase; -use Symfony\Component\CssSelector\CssSelector; - -/** - * @group legacy - */ -class CssSelectorTest extends TestCase -{ - public function testCssToXPath() - { - $this->assertEquals('descendant-or-self::*', CssSelector::toXPath('')); - $this->assertEquals('descendant-or-self::h1', CssSelector::toXPath('h1')); - $this->assertEquals("descendant-or-self::h1[@id = 'foo']", CssSelector::toXPath('h1#foo')); - $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", CssSelector::toXPath('h1.foo')); - $this->assertEquals('descendant-or-self::foo:h1', CssSelector::toXPath('foo|h1')); - } - - /** @dataProvider getCssToXPathWithoutPrefixTestData */ - public function testCssToXPathWithoutPrefix($css, $xpath) - { - $this->assertEquals($xpath, CssSelector::toXPath($css, ''), '->parse() parses an input string and returns a node'); - } - - public function testParseExceptions() - { - try { - CssSelector::toXPath('h1:'); - $this->fail('->parse() throws an Exception if the css selector is not valid'); - } catch (\Exception $e) { - $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid'); - $this->assertEquals('Expected identifier, but found.', $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); - } - } - - public function getCssToXPathWithoutPrefixTestData() - { - return array( - array('h1', 'h1'), - array('foo|h1', 'foo:h1'), - array('h1, h2, h3', 'h1 | h2 | h3'), - array('h1:nth-child(3n+1)', "*/*[(name() = 'h1') and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"), - array('h1 > p', 'h1/p'), - array('h1#foo', "h1[@id = 'foo']"), - array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"), - array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"), - array('h1[class]', 'h1[@class]'), - array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"), - array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"), - array('div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - array('div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), - ); - } -} diff --git a/application/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php index 1fd090f..4d60074 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/AttributeNodeTest.php @@ -18,20 +18,20 @@ class AttributeNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'), - array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"), - array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"), - ); + return [ + [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'], + [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"], + [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"], + ]; } public function getSpecificityValueTestData() { - return array( - array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10), - array(new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11), - array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10), - array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10), - ); + return [ + [new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10], + [new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11], + [new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10], + [new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php index e0ab45a..aa80c92 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/ClassNodeTest.php @@ -18,16 +18,16 @@ class ClassNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'), - ); + return [ + [new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new ClassNode(new ElementNode(), 'class'), 10), - array(new ClassNode(new ElementNode(null, 'element'), 'class'), 11), - ); + return [ + [new ClassNode(new ElementNode(), 'class'), 10], + [new ClassNode(new ElementNode(null, 'element'), 'class'), 11], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php index 9547298..435eaa6 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/CombinedSelectorNodeTest.php @@ -18,18 +18,18 @@ class CombinedSelectorNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'), - array(new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] Element[*]]'), - ); + return [ + [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'], + [new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] Element[*]]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0), - array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1), - array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2), - ); + return [ + [new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0], + [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1], + [new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php index 6d24789..e0797ff 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/ElementNodeTest.php @@ -17,19 +17,19 @@ class ElementNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new ElementNode(), 'Element[*]'), - array(new ElementNode(null, 'element'), 'Element[element]'), - array(new ElementNode('namespace', 'element'), 'Element[namespace|element]'), - ); + return [ + [new ElementNode(), 'Element[*]'], + [new ElementNode(null, 'element'), 'Element[element]'], + [new ElementNode('namespace', 'element'), 'Element[namespace|element]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new ElementNode(), 0), - array(new ElementNode(null, 'element'), 1), - array(new ElementNode('namespace', 'element'), 1), - ); + return [ + [new ElementNode(), 0], + [new ElementNode(null, 'element'), 1], + [new ElementNode('namespace', 'element'), 1], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php index ee3ce51..0932393 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php @@ -19,29 +19,29 @@ class FunctionNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'), - array(new FunctionNode(new ElementNode(), 'function', array( + return [ + [new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'], + [new FunctionNode(new ElementNode(), 'function', [ new Token(Token::TYPE_IDENTIFIER, 'value', 0), - )), "Function[Element[*]:function(['value'])]"), - array(new FunctionNode(new ElementNode(), 'function', array( + ]), "Function[Element[*]:function(['value'])]"], + [new FunctionNode(new ElementNode(), 'function', [ new Token(Token::TYPE_STRING, 'value1', 0), new Token(Token::TYPE_NUMBER, 'value2', 0), - )), "Function[Element[*]:function(['value1', 'value2'])]"), - ); + ]), "Function[Element[*]:function(['value1', 'value2'])]"], + ]; } public function getSpecificityValueTestData() { - return array( - array(new FunctionNode(new ElementNode(), 'function'), 10), - array(new FunctionNode(new ElementNode(), 'function', array( + return [ + [new FunctionNode(new ElementNode(), 'function'), 10], + [new FunctionNode(new ElementNode(), 'function', [ new Token(Token::TYPE_IDENTIFIER, 'value', 0), - )), 10), - array(new FunctionNode(new ElementNode(), 'function', array( + ]), 10], + [new FunctionNode(new ElementNode(), 'function', [ new Token(Token::TYPE_STRING, 'value1', 0), new Token(Token::TYPE_NUMBER, 'value2', 0), - )), 10), - ); + ]), 10], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php index 3bc74da..ad6765b 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/HashNodeTest.php @@ -18,16 +18,16 @@ class HashNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'), - ); + return [ + [new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new HashNode(new ElementNode(), 'id'), 100), - array(new HashNode(new ElementNode(null, 'id'), 'class'), 101), - ); + return [ + [new HashNode(new ElementNode(), 'id'), 100], + [new HashNode(new ElementNode(null, 'id'), 'class'), 101], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php index ed4d248..90b684c 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php @@ -19,15 +19,15 @@ class NegationNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'), - ); + return [ + [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10), - ); + return [ + [new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php index bc57813..4e78776 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/PseudoNodeTest.php @@ -18,15 +18,15 @@ class PseudoNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'), - ); + return [ + [new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new PseudoNode(new ElementNode(), 'pseudo'), 10), - ); + return [ + [new PseudoNode(new ElementNode(), 'pseudo'), 10], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php b/application/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php index 5badf71..85e3bda 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/SelectorNodeTest.php @@ -18,17 +18,17 @@ class SelectorNodeTest extends AbstractNodeTest { public function getToStringConversionTestData() { - return array( - array(new SelectorNode(new ElementNode()), 'Selector[Element[*]]'), - array(new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'), - ); + return [ + [new SelectorNode(new ElementNode()), 'Selector[Element[*]]'], + [new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'], + ]; } public function getSpecificityValueTestData() { - return array( - array(new SelectorNode(new ElementNode()), 0), - array(new SelectorNode(new ElementNode(), 'pseudo'), 1), - ); + return [ + [new SelectorNode(new ElementNode()), 0], + [new SelectorNode(new ElementNode(), 'pseudo'), 1], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php b/application/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php index b58eb89..bf48d49 100644 --- a/application/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php +++ b/application/vendor/symfony/css-selector/Tests/Node/SpecificityTest.php @@ -30,13 +30,13 @@ public function testPlusValue(Specificity $specificity, $value) public function getValueTestData() { - return array( - array(new Specificity(0, 0, 0), 0), - array(new Specificity(0, 0, 2), 2), - array(new Specificity(0, 3, 0), 30), - array(new Specificity(4, 0, 0), 400), - array(new Specificity(4, 3, 2), 432), - ); + return [ + [new Specificity(0, 0, 0), 0], + [new Specificity(0, 0, 2), 2], + [new Specificity(0, 3, 0), 30], + [new Specificity(4, 0, 0), 400], + [new Specificity(4, 3, 2), 432], + ]; } /** @dataProvider getCompareTestData */ @@ -47,17 +47,17 @@ public function testCompareTo(Specificity $a, Specificity $b, $result) public function getCompareTestData() { - return array( - array(new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0), - array(new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0), - array(new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1), - array(new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1), - array(new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0), - array(new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1), - array(new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1), - array(new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0), - array(new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1), - array(new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1), - ); + return [ + [new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0], + [new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0], + [new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1], + [new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1], + [new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0], + [new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1], + [new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1], + [new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0], + [new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1], + [new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php index f5c9dc8..aaed55c 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php @@ -54,7 +54,7 @@ protected function assertStreamEmpty(TokenStream $stream) $property = new \ReflectionProperty($stream, 'tokens'); $property->setAccessible(true); - $this->assertEquals(array(), $property->getValue($stream)); + $this->assertEquals([], $property->getValue($stream)); } protected function assertRemainingContent(Reader $reader, $remainingContent) diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php index 3961bf7..de40047 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/CommentHandlerTest.php @@ -32,20 +32,20 @@ public function testHandleValue($value, Token $unusedArgument, $remainingContent public function getHandleValueTestData() { - return array( + return [ // 2nd argument only exists for inherited method compatibility - array('/* comment */', new Token(null, null, null), ''), - array('/* comment */foo', new Token(null, null, null), 'foo'), - ); + ['/* comment */', new Token(null, null, null), ''], + ['/* comment */foo', new Token(null, null, null), 'foo'], + ]; } public function getDontHandleValueTestData() { - return array( - array('>'), - array('+'), - array(' '), - ); + return [ + ['>'], + ['+'], + [' '], + ]; } protected function generateHandler() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php index 5730120..9444f51 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/HashHandlerTest.php @@ -20,24 +20,24 @@ class HashHandlerTest extends AbstractHandlerTest { public function getHandleValueTestData() { - return array( - array('#id', new Token(Token::TYPE_HASH, 'id', 0), ''), - array('#123', new Token(Token::TYPE_HASH, '123', 0), ''), + return [ + ['#id', new Token(Token::TYPE_HASH, 'id', 0), ''], + ['#123', new Token(Token::TYPE_HASH, '123', 0), ''], - array('#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'), - array('#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'), - ); + ['#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'], + ['#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'], + ]; } public function getDontHandleValueTestData() { - return array( - array('id'), - array('123'), - array('<'), - array('<'), - array('#'), - ); + return [ + ['id'], + ['123'], + ['<'], + ['<'], + ['#'], + ]; } protected function generateHandler() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php index f56430c..c54ba53 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/IdentifierHandlerTest.php @@ -20,24 +20,24 @@ class IdentifierHandlerTest extends AbstractHandlerTest { public function getHandleValueTestData() { - return array( - array('foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''), - array('foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'), - array('foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'), - array('foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'), - array('foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'), - ); + return [ + ['foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''], + ['foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'], + ['foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'], + ['foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'], + ['foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'], + ]; } public function getDontHandleValueTestData() { - return array( - array('>'), - array('+'), - array(' '), - array('*|foo'), - array('/* comment */'), - ); + return [ + ['>'], + ['+'], + [' '], + ['*|foo'], + ['/* comment */'], + ]; } protected function generateHandler() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php index 675fd05..b43d369 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/NumberHandlerTest.php @@ -19,26 +19,26 @@ class NumberHandlerTest extends AbstractHandlerTest { public function getHandleValueTestData() { - return array( - array('12', new Token(Token::TYPE_NUMBER, '12', 0), ''), - array('12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''), - array('+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''), - array('-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''), - - array('12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'), - array('12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'), - ); + return [ + ['12', new Token(Token::TYPE_NUMBER, '12', 0), ''], + ['12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''], + ['+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''], + ['-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''], + + ['12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'], + ['12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'], + ]; } public function getDontHandleValueTestData() { - return array( - array('hello'), - array('>'), - array('+'), - array(' '), - array('/* comment */'), - ); + return [ + ['hello'], + ['>'], + ['+'], + [' '], + ['/* comment */'], + ]; } protected function generateHandler() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php index 8ea5d4d..baa7273 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/StringHandlerTest.php @@ -20,25 +20,25 @@ class StringHandlerTest extends AbstractHandlerTest { public function getHandleValueTestData() { - return array( - array('"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''), - array('"1"', new Token(Token::TYPE_STRING, '1', 1), ''), - array('" "', new Token(Token::TYPE_STRING, ' ', 1), ''), - array('""', new Token(Token::TYPE_STRING, '', 1), ''), - array("'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''), - - array("'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'), - ); + return [ + ['"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''], + ['"1"', new Token(Token::TYPE_STRING, '1', 1), ''], + ['" "', new Token(Token::TYPE_STRING, ' ', 1), ''], + ['""', new Token(Token::TYPE_STRING, '', 1), ''], + ["'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''], + + ["'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'], + ]; } public function getDontHandleValueTestData() { - return array( - array('hello'), - array('>'), - array('1'), - array(' '), - ); + return [ + ['hello'], + ['>'], + ['1'], + [' '], + ]; } protected function generateHandler() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php index f5f9e71..67509ef 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Handler/WhitespaceHandlerTest.php @@ -18,23 +18,23 @@ class WhitespaceHandlerTest extends AbstractHandlerTest { public function getHandleValueTestData() { - return array( - array(' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''), - array("\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''), - array("\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''), + return [ + [' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''], + ["\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''], + ["\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''], - array(' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'), - array(' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'), - ); + [' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'], + [' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'], + ]; } public function getDontHandleValueTestData() { - return array( - array('>'), - array('1'), - array('a'), - ); + return [ + ['>'], + ['1'], + ['a'], + ]; } protected function generateHandler() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/ParserTest.php b/application/vendor/symfony/css-selector/Tests/Parser/ParserTest.php index 53b35a9..f63a15e 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/ParserTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/ParserTest.php @@ -77,7 +77,7 @@ public function testParseSeries($series, $a, $b) /** @var FunctionNode $function */ $function = $selectors[0]->getTree(); - $this->assertEquals(array($a, $b), Parser::parseSeries($function->getArguments())); + $this->assertEquals([$a, $b], Parser::parseSeries($function->getArguments())); } /** @dataProvider getParseSeriesExceptionTestData */ @@ -89,162 +89,165 @@ public function testParseSeriesException($series) /** @var FunctionNode $function */ $function = $selectors[0]->getTree(); - $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); + $this->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); Parser::parseSeries($function->getArguments()); } public function getParserTestData() { - return array( - array('*', array('Element[*]')), - array('*|*', array('Element[*]')), - array('*|foo', array('Element[foo]')), - array('foo|*', array('Element[foo|*]')), - array('foo|bar', array('Element[foo|bar]')), - array('#foo#bar', array('Hash[Hash[Element[*]#foo]#bar]')), - array('div>.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('div> .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('div >.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('div > .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array("div \n> \t \t .foo", array('CombinedSelector[Element[div] > Class[Element[*].foo]]')), - array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')), - array('div, td.foo, div.bar span', array('Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] Element[span]]')), - array('div > p', array('CombinedSelector[Element[div] > Element[p]]')), - array('td:first', array('Pseudo[Element[td]:first]')), - array('td :first', array('CombinedSelector[Element[td] Pseudo[Element[*]:first]]')), - array('a[name]', array('Attribute[Element[a][name]]')), - array("a[ name\t]", array('Attribute[Element[a][name]]')), - array('a [name]', array('CombinedSelector[Element[a] Attribute[Element[*][name]]]')), - array('a[rel="include"]', array("Attribute[Element[a][rel = 'include']]")), - array('a[rel = include]', array("Attribute[Element[a][rel = 'include']]")), - array("a[hreflang |= 'en']", array("Attribute[Element[a][hreflang |= 'en']]")), - array('a[hreflang|=en]', array("Attribute[Element[a][hreflang |= 'en']]")), - array('div:nth-child(10)', array("Function[Element[div]:nth-child(['10'])]")), - array(':nth-child(2n+2)', array("Function[Element[*]:nth-child(['2', 'n', '+2'])]")), - array('div:nth-of-type(10)', array("Function[Element[div]:nth-of-type(['10'])]")), - array('div div:nth-of-type(10) .aclass', array("CombinedSelector[CombinedSelector[Element[div] Function[Element[div]:nth-of-type(['10'])]] Class[Element[*].aclass]]")), - array('label:only', array('Pseudo[Element[label]:only]')), - array('a:lang(fr)', array("Function[Element[a]:lang(['fr'])]")), - array('div:contains("foo")', array("Function[Element[div]:contains(['foo'])]")), - array('div#foobar', array('Hash[Element[div]#foobar]')), - array('div:not(div.foo)', array('Negation[Element[div]:not(Class[Element[div].foo])]')), - array('td ~ th', array('CombinedSelector[Element[td] ~ Element[th]]')), - array('.foo[data-bar][data-baz=0]', array("Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]")), - ); + return [ + ['*', ['Element[*]']], + ['*|*', ['Element[*]']], + ['*|foo', ['Element[foo]']], + ['foo|*', ['Element[foo|*]']], + ['foo|bar', ['Element[foo|bar]']], + ['#foo#bar', ['Hash[Hash[Element[*]#foo]#bar]']], + ['div>.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['div> .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['div >.foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['div > .foo', ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ["div \n> \t \t .foo", ['CombinedSelector[Element[div] > Class[Element[*].foo]]']], + ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['td.foo,.bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['td.foo, .bar', ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ["td.foo\t\r\n\f ,\t\r\n\f .bar", ['Class[Element[td].foo]', 'Class[Element[*].bar]']], + ['div, td.foo, div.bar span', ['Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] Element[span]]']], + ['div > p', ['CombinedSelector[Element[div] > Element[p]]']], + ['td:first', ['Pseudo[Element[td]:first]']], + ['td :first', ['CombinedSelector[Element[td] Pseudo[Element[*]:first]]']], + ['a[name]', ['Attribute[Element[a][name]]']], + ["a[ name\t]", ['Attribute[Element[a][name]]']], + ['a [name]', ['CombinedSelector[Element[a] Attribute[Element[*][name]]]']], + ['[name="foo"]', ["Attribute[Element[*][name = 'foo']]"]], + ["[name='foo[1]']", ["Attribute[Element[*][name = 'foo[1]']]"]], + ["[name='foo[0][bar]']", ["Attribute[Element[*][name = 'foo[0][bar]']]"]], + ['a[rel="include"]', ["Attribute[Element[a][rel = 'include']]"]], + ['a[rel = include]', ["Attribute[Element[a][rel = 'include']]"]], + ["a[hreflang |= 'en']", ["Attribute[Element[a][hreflang |= 'en']]"]], + ['a[hreflang|=en]', ["Attribute[Element[a][hreflang |= 'en']]"]], + ['div:nth-child(10)', ["Function[Element[div]:nth-child(['10'])]"]], + [':nth-child(2n+2)', ["Function[Element[*]:nth-child(['2', 'n', '+2'])]"]], + ['div:nth-of-type(10)', ["Function[Element[div]:nth-of-type(['10'])]"]], + ['div div:nth-of-type(10) .aclass', ["CombinedSelector[CombinedSelector[Element[div] Function[Element[div]:nth-of-type(['10'])]] Class[Element[*].aclass]]"]], + ['label:only', ['Pseudo[Element[label]:only]']], + ['a:lang(fr)', ["Function[Element[a]:lang(['fr'])]"]], + ['div:contains("foo")', ["Function[Element[div]:contains(['foo'])]"]], + ['div#foobar', ['Hash[Element[div]#foobar]']], + ['div:not(div.foo)', ['Negation[Element[div]:not(Class[Element[div].foo])]']], + ['td ~ th', ['CombinedSelector[Element[td] ~ Element[th]]']], + ['.foo[data-bar][data-baz=0]', ["Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]"]], + ]; } public function getParserExceptionTestData() { - return array( - array('attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()), - array('attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()), - array('html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()), - array(' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()), - array('div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()), - array(' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()), - array('p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()), - array('div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()), - array(' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()), - array('foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()), - array('#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()), - array('.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()), - array(':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()), - array('[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()), - array('[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()), - array('[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()), - array('[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()), - array(':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()), - array('[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()), - array('[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()), - array('[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()), - array(':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()), - array(':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()), - array('foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()), - ); + return [ + ['attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], + ['attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()], + ['html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()], + [' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()], + ['div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()], + [' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()], + ['p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()], + ['div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()], + [' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()], + ['foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()], + ['#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()], + ['.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], + [':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()], + ['[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()], + ['[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()], + ['[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()], + ['[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()], + [':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()], + ['[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()], + ['[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()], + ['[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()], + [':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()], + [':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()], + ['foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()], + ]; } public function getPseudoElementsTestData() { - return array( - array('foo', 'Element[foo]', ''), - array('*', 'Element[*]', ''), - array(':empty', 'Pseudo[Element[*]:empty]', ''), - array(':BEfore', 'Element[*]', 'before'), - array(':aftER', 'Element[*]', 'after'), - array(':First-Line', 'Element[*]', 'first-line'), - array(':First-Letter', 'Element[*]', 'first-letter'), - array('::befoRE', 'Element[*]', 'before'), - array('::AFter', 'Element[*]', 'after'), - array('::firsT-linE', 'Element[*]', 'first-line'), - array('::firsT-letteR', 'Element[*]', 'first-letter'), - array('::Selection', 'Element[*]', 'selection'), - array('foo:after', 'Element[foo]', 'after'), - array('foo::selection', 'Element[foo]', 'selection'), - array('lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'), - array('video::-webkit-media-controls', 'Element[video]', '-webkit-media-controls'), - ); + return [ + ['foo', 'Element[foo]', ''], + ['*', 'Element[*]', ''], + [':empty', 'Pseudo[Element[*]:empty]', ''], + [':BEfore', 'Element[*]', 'before'], + [':aftER', 'Element[*]', 'after'], + [':First-Line', 'Element[*]', 'first-line'], + [':First-Letter', 'Element[*]', 'first-letter'], + ['::befoRE', 'Element[*]', 'before'], + ['::AFter', 'Element[*]', 'after'], + ['::firsT-linE', 'Element[*]', 'first-line'], + ['::firsT-letteR', 'Element[*]', 'first-letter'], + ['::Selection', 'Element[*]', 'selection'], + ['foo:after', 'Element[foo]', 'after'], + ['foo::selection', 'Element[foo]', 'selection'], + ['lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'], + ['video::-webkit-media-controls', 'Element[video]', '-webkit-media-controls'], + ]; } public function getSpecificityTestData() { - return array( - array('*', 0), - array(' foo', 1), - array(':empty ', 10), - array(':before', 1), - array('*:before', 1), - array(':nth-child(2)', 10), - array('.bar', 10), - array('[baz]', 10), - array('[baz="4"]', 10), - array('[baz^="4"]', 10), - array('#lipsum', 100), - array(':not(*)', 0), - array(':not(foo)', 1), - array(':not(.foo)', 10), - array(':not([foo])', 10), - array(':not(:empty)', 10), - array(':not(#foo)', 100), - array('foo:empty', 11), - array('foo:before', 2), - array('foo::before', 2), - array('foo:empty::before', 12), - array('#lorem + foo#ipsum:first-child > bar:first-line', 213), - ); + return [ + ['*', 0], + [' foo', 1], + [':empty ', 10], + [':before', 1], + ['*:before', 1], + [':nth-child(2)', 10], + ['.bar', 10], + ['[baz]', 10], + ['[baz="4"]', 10], + ['[baz^="4"]', 10], + ['#lipsum', 100], + [':not(*)', 0], + [':not(foo)', 1], + [':not(.foo)', 10], + [':not([foo])', 10], + [':not(:empty)', 10], + [':not(#foo)', 100], + ['foo:empty', 11], + ['foo:before', 2], + ['foo::before', 2], + ['foo:empty::before', 12], + ['#lorem + foo#ipsum:first-child > bar:first-line', 213], + ]; } public function getParseSeriesTestData() { - return array( - array('1n+3', 1, 3), - array('1n +3', 1, 3), - array('1n + 3', 1, 3), - array('1n+ 3', 1, 3), - array('1n-3', 1, -3), - array('1n -3', 1, -3), - array('1n - 3', 1, -3), - array('1n- 3', 1, -3), - array('n-5', 1, -5), - array('odd', 2, 1), - array('even', 2, 0), - array('3n', 3, 0), - array('n', 1, 0), - array('+n', 1, 0), - array('-n', -1, 0), - array('5', 0, 5), - ); + return [ + ['1n+3', 1, 3], + ['1n +3', 1, 3], + ['1n + 3', 1, 3], + ['1n+ 3', 1, 3], + ['1n-3', 1, -3], + ['1n -3', 1, -3], + ['1n - 3', 1, -3], + ['1n- 3', 1, -3], + ['n-5', 1, -5], + ['odd', 2, 1], + ['even', 2, 0], + ['3n', 3, 0], + ['n', 1, 0], + ['+n', 1, 0], + ['-n', -1, 0], + ['5', 0, 5], + ]; } public function getParseSeriesExceptionTestData() { - return array( - array('foo'), - array('n+'), - ); + return [ + ['foo'], + ['n+'], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php b/application/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php index 21eb608..ff9ea90 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php @@ -70,11 +70,11 @@ public function testFindPattern() $reader = new Reader('hello'); $this->assertFalse($reader->findPattern('/world/')); - $this->assertEquals(array('hello', 'h'), $reader->findPattern('/^([a-z]).*/')); + $this->assertEquals(['hello', 'h'], $reader->findPattern('/^([a-z]).*/')); $this->assignPosition($reader, 2); $this->assertFalse($reader->findPattern('/^h.*/')); - $this->assertEquals(array('llo'), $reader->findPattern('/^llo$/')); + $this->assertEquals(['llo'], $reader->findPattern('/^llo$/')); } public function testMoveForward() diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php index 7e92f5b..29d9d5f 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ClassParserTest.php @@ -34,12 +34,12 @@ public function testParse($source, $representation) public function getParseTestData() { - return array( - array('.testclass', 'Class[Element[*].testclass]'), - array('testel.testclass', 'Class[Element[testel].testclass]'), - array('testns|.testclass', 'Class[Element[testns|*].testclass]'), - array('testns|*.testclass', 'Class[Element[testns|*].testclass]'), - array('testns|testel.testclass', 'Class[Element[testns|testel].testclass]'), - ); + return [ + ['.testclass', 'Class[Element[*].testclass]'], + ['testel.testclass', 'Class[Element[testel].testclass]'], + ['testns|.testclass', 'Class[Element[testns|*].testclass]'], + ['testns|*.testclass', 'Class[Element[testns|*].testclass]'], + ['testns|testel.testclass', 'Class[Element[testns|testel].testclass]'], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php index 05a730f..79cc227 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php @@ -34,11 +34,11 @@ public function testParse($source, $representation) public function getParseTestData() { - return array( - array('*', 'Element[*]'), - array('testel', 'Element[testel]'), - array('testns|*', 'Element[testns|*]'), - array('testns|testel', 'Element[testns|testel]'), - ); + return [ + ['*', 'Element[*]'], + ['testel', 'Element[testel]'], + ['testns|*', 'Element[testns|*]'], + ['testns|testel', 'Element[testns|testel]'], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php b/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php index 82f555d..a7c79d6 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/Shortcut/HashParserTest.php @@ -34,12 +34,12 @@ public function testParse($source, $representation) public function getParseTestData() { - return array( - array('#testid', 'Hash[Element[*]#testid]'), - array('testel#testid', 'Hash[Element[testel]#testid]'), - array('testns|#testid', 'Hash[Element[testns|*]#testid]'), - array('testns|*#testid', 'Hash[Element[testns|*]#testid]'), - array('testns|testel#testid', 'Hash[Element[testns|testel]#testid]'), - ); + return [ + ['#testid', 'Hash[Element[*]#testid]'], + ['testel#testid', 'Hash[Element[testel]#testid]'], + ['testns|#testid', 'Hash[Element[testns|*]#testid]'], + ['testns|*#testid', 'Hash[Element[testns|*]#testid]'], + ['testns|testel#testid', 'Hash[Element[testns|testel]#testid]'], + ]; } } diff --git a/application/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php b/application/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php index 44c751a..fb47625 100644 --- a/application/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php +++ b/application/vendor/symfony/css-selector/Tests/Parser/TokenStreamTest.php @@ -53,7 +53,7 @@ public function testGetNextIdentifier() public function testFailToGetNextIdentifier() { - $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); + $this->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); $stream = new TokenStream(); $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); @@ -73,7 +73,7 @@ public function testGetNextIdentifierOrStar() public function testFailToGetNextIdentifierOrStar() { - $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); + $this->expectException('Symfony\Component\CssSelector\Exception\SyntaxErrorException'); $stream = new TokenStream(); $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2)); diff --git a/application/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php b/application/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php index 6104582..a718fbd 100644 --- a/application/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php +++ b/application/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php @@ -12,8 +12,12 @@ namespace Symfony\Component\CssSelector\Tests\XPath; use PHPUnit\Framework\TestCase; +use Symfony\Component\CssSelector\Node\ElementNode; +use Symfony\Component\CssSelector\Node\FunctionNode; +use Symfony\Component\CssSelector\Parser\Parser; use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; use Symfony\Component\CssSelector\XPath\Translator; +use Symfony\Component\CssSelector\XPath\XPathExpr; class TranslatorTest extends TestCase { @@ -31,6 +35,61 @@ public function testCssToXPath($css, $xpath) $this->assertEquals($xpath, $translator->cssToXPath($css, '')); } + public function testCssToXPathPseudoElement() + { + $this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $translator->cssToXPath('e::first-line'); + } + + public function testGetExtensionNotExistsExtension() + { + $this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $translator->getExtension('fake'); + } + + public function testAddCombinationNotExistsExtension() + { + $this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $parser = new Parser(); + $xpath = $parser->parse('*')[0]; + $combinedXpath = $parser->parse('*')[0]; + $translator->addCombination('fake', $xpath, $combinedXpath); + } + + public function testAddFunctionNotExistsFunction() + { + $this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $xpath = new XPathExpr(); + $function = new FunctionNode(new ElementNode(), 'fake'); + $translator->addFunction($xpath, $function); + } + + public function testAddPseudoClassNotExistsClass() + { + $this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $xpath = new XPathExpr(); + $translator->addPseudoClass($xpath, 'fake'); + } + + public function testAddAttributeMatchingClassNotExistsClass() + { + $this->expectException('Symfony\Component\CssSelector\Exception\ExpressionErrorException'); + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $xpath = new XPathExpr(); + $translator->addAttributeMatching($xpath, '', '', ''); + } + /** @dataProvider getXmlLangTestData */ public function testXmlLang($css, array $elementsId) { @@ -39,7 +98,7 @@ public function testXmlLang($css, array $elementsId) $elements = $document->xpath($translator->cssToXPath($css)); $this->assertCount(\count($elementsId), $elements); foreach ($elements as $element) { - $this->assertTrue(\in_array($element->attributes()->id, $elementsId)); + $this->assertContains((string) $element->attributes()->id, $elementsId); } } @@ -57,7 +116,7 @@ public function testHtmlIds($css, array $elementsId) $this->assertCount(\count($elementsId), $elementsId); foreach ($elements as $element) { if (null !== $element->attributes()->id) { - $this->assertTrue(\in_array($element->attributes()->id, $elementsId)); + $this->assertContains((string) $element->attributes()->id, $elementsId); } } libxml_clear_errors(); @@ -78,250 +137,277 @@ public function testHtmlShakespear($css, $count) $this->assertCount($count, $elements); } + public function testOnlyOfTypeFindsSingleChildrenOfGivenType() + { + $translator = new Translator(); + $translator->registerExtension(new HtmlExtension($translator)); + $document = new \DOMDocument(); + $document->loadHTML(<<<'HTML' + + +

    + A +

    +

    + B + C +

    + + +HTML +); + + $xpath = new \DOMXPath($document); + $nodeList = $xpath->query($translator->cssToXPath('span:only-of-type')); + + $this->assertSame(1, $nodeList->length); + $this->assertSame('A', $nodeList->item(0)->textContent); + } + public function getXpathLiteralTestData() { - return array( - array('foo', "'foo'"), - array("foo's bar", '"foo\'s bar"'), - array("foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'), - array("foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'), - ); + return [ + ['foo', "'foo'"], + ["foo's bar", '"foo\'s bar"'], + ["foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'], + ["foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'], + ]; } public function getCssToXPathTestData() { - return array( - array('*', '*'), - array('e', 'e'), - array('*|e', 'e'), - array('e|f', 'e:f'), - array('e[foo]', 'e[@foo]'), - array('e[foo|bar]', 'e[@foo:bar]'), - array('e[foo="bar"]', "e[@foo = 'bar']"), - array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"), - array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"), - array('e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"), - array('e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"), - array('e[foo!="bar"]', "e[not(@foo) or @foo != 'bar']"), - array('e[foo!="bar"][foo!="baz"]', "e[(not(@foo) or @foo != 'bar') and (not(@foo) or @foo != 'baz')]"), - array('e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"), - array('e:nth-child(1)', "*/*[(name() = 'e') and (position() = 1)]"), - array('e:nth-last-child(1)', "*/*[(name() = 'e') and (position() = last() - 0)]"), - array('e:nth-last-child(2n+2)', "*/*[(name() = 'e') and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"), - array('e:nth-of-type(1)', '*/e[position() = 1]'), - array('e:nth-last-of-type(1)', '*/e[position() = last() - 0]'), - array('div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"), - array('e:first-child', "*/*[(name() = 'e') and (position() = 1)]"), - array('e:last-child', "*/*[(name() = 'e') and (position() = last())]"), - array('e:first-of-type', '*/e[position() = 1]'), - array('e:last-of-type', '*/e[position() = last()]'), - array('e:only-child', "*/*[(name() = 'e') and (last() = 1)]"), - array('e:only-of-type', 'e[last() = 1]'), - array('e:empty', 'e[not(*) and not(string-length())]'), - array('e:EmPTY', 'e[not(*) and not(string-length())]'), - array('e:root', 'e[not(parent::*)]'), - array('e:hover', 'e[0]'), - array('e:contains("foo")', "e[contains(string(.), 'foo')]"), - array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"), - array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"), - array('e#myid', "e[@id = 'myid']"), - array('e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'), - array('e:nOT(*)', 'e[0]'), - array('e f', 'e/descendant-or-self::*/f'), - array('e > f', 'e/f'), - array('e + f', "e/following-sibling::*[(name() = 'f') and (position() = 1)]"), - array('e ~ f', 'e/following-sibling::f'), - array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"), - ); + return [ + ['*', '*'], + ['e', 'e'], + ['*|e', 'e'], + ['e|f', 'e:f'], + ['e[foo]', 'e[@foo]'], + ['e[foo|bar]', 'e[@foo:bar]'], + ['e[foo="bar"]', "e[@foo = 'bar']"], + ['e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"], + ['e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"], + ['e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"], + ['e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"], + ['e[foo!="bar"]', "e[not(@foo) or @foo != 'bar']"], + ['e[foo!="bar"][foo!="baz"]', "e[(not(@foo) or @foo != 'bar') and (not(@foo) or @foo != 'baz')]"], + ['e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"], + ['e:nth-child(1)', "*/*[(name() = 'e') and (position() = 1)]"], + ['e:nth-last-child(1)', "*/*[(name() = 'e') and (position() = last() - 0)]"], + ['e:nth-last-child(2n+2)', "*/*[(name() = 'e') and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"], + ['e:nth-of-type(1)', '*/e[position() = 1]'], + ['e:nth-last-of-type(1)', '*/e[position() = last() - 0]'], + ['div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"], + ['e:first-child', "*/*[(name() = 'e') and (position() = 1)]"], + ['e:last-child', "*/*[(name() = 'e') and (position() = last())]"], + ['e:first-of-type', '*/e[position() = 1]'], + ['e:last-of-type', '*/e[position() = last()]'], + ['e:only-child', "*/*[(name() = 'e') and (last() = 1)]"], + ['e:only-of-type', 'e[count(preceding-sibling::e)=0 and count(following-sibling::e)=0]'], + ['e:empty', 'e[not(*) and not(string-length())]'], + ['e:EmPTY', 'e[not(*) and not(string-length())]'], + ['e:root', 'e[not(parent::*)]'], + ['e:hover', 'e[0]'], + ['e:contains("foo")', "e[contains(string(.), 'foo')]"], + ['e:ConTains(foo)', "e[contains(string(.), 'foo')]"], + ['e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"], + ['e#myid', "e[@id = 'myid']"], + ['e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'], + ['e:nOT(*)', 'e[0]'], + ['e f', 'e/descendant-or-self::*/f'], + ['e > f', 'e/f'], + ['e + f', "e/following-sibling::*[(name() = 'f') and (position() = 1)]"], + ['e ~ f', 'e/following-sibling::f'], + ['div#container p', "div[@id = 'container']/descendant-or-self::*/p"], + ]; } public function getXmlLangTestData() { - return array( - array(':lang("EN")', array('first', 'second', 'third', 'fourth')), - array(':lang("en-us")', array('second', 'fourth')), - array(':lang(en-nz)', array('third')), - array(':lang(fr)', array('fifth')), - array(':lang(ru)', array('sixth')), - array(":lang('ZH')", array('eighth')), - array(':lang(de) :lang(zh)', array('eighth')), - array(':lang(en), :lang(zh)', array('first', 'second', 'third', 'fourth', 'eighth')), - array(':lang(es)', array()), - ); + return [ + [':lang("EN")', ['first', 'second', 'third', 'fourth']], + [':lang("en-us")', ['second', 'fourth']], + [':lang(en-nz)', ['third']], + [':lang(fr)', ['fifth']], + [':lang(ru)', ['sixth']], + [":lang('ZH')", ['eighth']], + [':lang(de) :lang(zh)', ['eighth']], + [':lang(en), :lang(zh)', ['first', 'second', 'third', 'fourth', 'eighth']], + [':lang(es)', []], + ]; } public function getHtmlIdsTestData() { - return array( - array('div', array('outer-div', 'li-div', 'foobar-div')), - array('DIV', array('outer-div', 'li-div', 'foobar-div')), // case-insensitive in HTML - array('div div', array('li-div')), - array('div, div div', array('outer-div', 'li-div', 'foobar-div')), - array('a[name]', array('name-anchor')), - array('a[NAme]', array('name-anchor')), // case-insensitive in HTML: - array('a[rel]', array('tag-anchor', 'nofollow-anchor')), - array('a[rel="tag"]', array('tag-anchor')), - array('a[href*="localhost"]', array('tag-anchor')), - array('a[href*=""]', array()), - array('a[href^="http"]', array('tag-anchor', 'nofollow-anchor')), - array('a[href^="http:"]', array('tag-anchor')), - array('a[href^=""]', array()), - array('a[href$="org"]', array('nofollow-anchor')), - array('a[href$=""]', array()), - array('div[foobar~="bc"]', array('foobar-div')), - array('div[foobar~="cde"]', array('foobar-div')), - array('[foobar~="ab bc"]', array('foobar-div')), - array('[foobar~=""]', array()), - array('[foobar~=" \t"]', array()), - array('div[foobar~="cd"]', array()), - array('*[lang|="En"]', array('second-li')), - array('[lang|="En-us"]', array('second-li')), + return [ + ['div', ['outer-div', 'li-div', 'foobar-div']], + ['DIV', ['outer-div', 'li-div', 'foobar-div']], // case-insensitive in HTML + ['div div', ['li-div']], + ['div, div div', ['outer-div', 'li-div', 'foobar-div']], + ['a[name]', ['name-anchor']], + ['a[NAme]', ['name-anchor']], // case-insensitive in HTML: + ['a[rel]', ['tag-anchor', 'nofollow-anchor']], + ['a[rel="tag"]', ['tag-anchor']], + ['a[href*="localhost"]', ['tag-anchor']], + ['a[href*=""]', []], + ['a[href^="http"]', ['tag-anchor', 'nofollow-anchor']], + ['a[href^="http:"]', ['tag-anchor']], + ['a[href^=""]', []], + ['a[href$="org"]', ['nofollow-anchor']], + ['a[href$=""]', []], + ['div[foobar~="bc"]', ['foobar-div']], + ['div[foobar~="cde"]', ['foobar-div']], + ['[foobar~="ab bc"]', ['foobar-div']], + ['[foobar~=""]', []], + ['[foobar~=" \t"]', []], + ['div[foobar~="cd"]', []], + ['*[lang|="En"]', ['second-li']], + ['[lang|="En-us"]', ['second-li']], // Attribute values are case sensitive - array('*[lang|="en"]', array()), - array('[lang|="en-US"]', array()), - array('*[lang|="e"]', array()), + ['*[lang|="en"]', []], + ['[lang|="en-US"]', []], + ['*[lang|="e"]', []], // ... :lang() is not. - array(':lang("EN")', array('second-li', 'li-div')), - array('*:lang(en-US)', array('second-li', 'li-div')), - array(':lang("e")', array()), - array('li:nth-child(3)', array('third-li')), - array('li:nth-child(10)', array()), - array('li:nth-child(2n)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-child(even)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-child(2n+0)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-child(+2n+1)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')), - array('li:nth-child(odd)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')), - array('li:nth-child(2n+4)', array('fourth-li', 'sixth-li')), - array('li:nth-child(3n+1)', array('first-li', 'fourth-li', 'seventh-li')), - array('li:nth-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(n+3)', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-child(-n)', array()), - array('li:nth-child(-n-1)', array()), - array('li:nth-child(-n+1)', array('first-li')), - array('li:nth-child(-n+3)', array('first-li', 'second-li', 'third-li')), - array('li:nth-last-child(0)', array()), - array('li:nth-last-child(2n)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-last-child(even)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-last-child(2n+2)', array('second-li', 'fourth-li', 'sixth-li')), - array('li:nth-last-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n-3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')), - array('li:nth-last-child(n+3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li')), - array('li:nth-last-child(-n)', array()), - array('li:nth-last-child(-n-1)', array()), - array('li:nth-last-child(-n+1)', array('seventh-li')), - array('li:nth-last-child(-n+3)', array('fifth-li', 'sixth-li', 'seventh-li')), - array('ol:first-of-type', array('first-ol')), - array('ol:nth-child(1)', array('first-ol')), - array('ol:nth-of-type(2)', array('second-ol')), - array('ol:nth-last-of-type(1)', array('second-ol')), - array('span:only-child', array('foobar-span')), - array('li div:only-child', array('li-div')), - array('div *:only-child', array('li-div', 'foobar-span')), - array('p:only-of-type', array('paragraph')), - array('a:empty', array('name-anchor')), - array('a:EMpty', array('name-anchor')), - array('li:empty', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li')), - array(':root', array('html')), - array('html:root', array('html')), - array('li:root', array()), - array('* :root', array()), - array('*:contains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')), - array(':CONtains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')), - array('*:contains("LInk")', array()), // case sensitive - array('*:contains("e")', array('html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em')), - array('*:contains("E")', array()), // case-sensitive - array('.a', array('first-ol')), - array('.b', array('first-ol')), - array('*.a', array('first-ol')), - array('ol.a', array('first-ol')), - array('.c', array('first-ol', 'third-li', 'fourth-li')), - array('*.c', array('first-ol', 'third-li', 'fourth-li')), - array('ol *.c', array('third-li', 'fourth-li')), - array('ol li.c', array('third-li', 'fourth-li')), - array('li ~ li.c', array('third-li', 'fourth-li')), - array('ol > li.c', array('third-li', 'fourth-li')), - array('#first-li', array('first-li')), - array('li#first-li', array('first-li')), - array('*#first-li', array('first-li')), - array('li div', array('li-div')), - array('li > div', array('li-div')), - array('div div', array('li-div')), - array('div > div', array()), - array('div>.c', array('first-ol')), - array('div > .c', array('first-ol')), - array('div + div', array('foobar-div')), - array('a ~ a', array('tag-anchor', 'nofollow-anchor')), - array('a[rel="tag"] ~ a', array('nofollow-anchor')), - array('ol#first-ol li:last-child', array('seventh-li')), - array('ol#first-ol *:last-child', array('li-div', 'seventh-li')), - array('#outer-div:first-child', array('outer-div')), - array('#outer-div :first-child', array('name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href')), - array('a[href]', array('tag-anchor', 'nofollow-anchor')), - array(':not(*)', array()), - array('a:not([href])', array('name-anchor')), - array('ol :Not(li[class])', array('first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li')), + [':lang("EN")', ['second-li', 'li-div']], + ['*:lang(en-US)', ['second-li', 'li-div']], + [':lang("e")', []], + ['li:nth-child(3)', ['third-li']], + ['li:nth-child(10)', []], + ['li:nth-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-child(even)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-child(2n+0)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-child(+2n+1)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], + ['li:nth-child(odd)', ['first-li', 'third-li', 'fifth-li', 'seventh-li']], + ['li:nth-child(2n+4)', ['fourth-li', 'sixth-li']], + ['li:nth-child(3n+1)', ['first-li', 'fourth-li', 'seventh-li']], + ['li:nth-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(n+3)', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-child(-n)', []], + ['li:nth-child(-n-1)', []], + ['li:nth-child(-n+1)', ['first-li']], + ['li:nth-child(-n+3)', ['first-li', 'second-li', 'third-li']], + ['li:nth-last-child(0)', []], + ['li:nth-last-child(2n)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-last-child(even)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-last-child(2n+2)', ['second-li', 'fourth-li', 'sixth-li']], + ['li:nth-last-child(n)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n-1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n-3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n+1)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li']], + ['li:nth-last-child(n+3)', ['first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li']], + ['li:nth-last-child(-n)', []], + ['li:nth-last-child(-n-1)', []], + ['li:nth-last-child(-n+1)', ['seventh-li']], + ['li:nth-last-child(-n+3)', ['fifth-li', 'sixth-li', 'seventh-li']], + ['ol:first-of-type', ['first-ol']], + ['ol:nth-child(1)', ['first-ol']], + ['ol:nth-of-type(2)', ['second-ol']], + ['ol:nth-last-of-type(1)', ['second-ol']], + ['span:only-child', ['foobar-span']], + ['li div:only-child', ['li-div']], + ['div *:only-child', ['li-div', 'foobar-span']], + ['p:only-of-type', ['paragraph']], + ['a:empty', ['name-anchor']], + ['a:EMpty', ['name-anchor']], + ['li:empty', ['third-li', 'fourth-li', 'fifth-li', 'sixth-li']], + [':root', ['html']], + ['html:root', ['html']], + ['li:root', []], + ['* :root', []], + ['*:contains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], + [':CONtains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']], + ['*:contains("LInk")', []], // case sensitive + ['*:contains("e")', ['html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em']], + ['*:contains("E")', []], // case-sensitive + ['.a', ['first-ol']], + ['.b', ['first-ol']], + ['*.a', ['first-ol']], + ['ol.a', ['first-ol']], + ['.c', ['first-ol', 'third-li', 'fourth-li']], + ['*.c', ['first-ol', 'third-li', 'fourth-li']], + ['ol *.c', ['third-li', 'fourth-li']], + ['ol li.c', ['third-li', 'fourth-li']], + ['li ~ li.c', ['third-li', 'fourth-li']], + ['ol > li.c', ['third-li', 'fourth-li']], + ['#first-li', ['first-li']], + ['li#first-li', ['first-li']], + ['*#first-li', ['first-li']], + ['li div', ['li-div']], + ['li > div', ['li-div']], + ['div div', ['li-div']], + ['div > div', []], + ['div>.c', ['first-ol']], + ['div > .c', ['first-ol']], + ['div + div', ['foobar-div']], + ['a ~ a', ['tag-anchor', 'nofollow-anchor']], + ['a[rel="tag"] ~ a', ['nofollow-anchor']], + ['ol#first-ol li:last-child', ['seventh-li']], + ['ol#first-ol *:last-child', ['li-div', 'seventh-li']], + ['#outer-div:first-child', ['outer-div']], + ['#outer-div :first-child', ['name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href']], + ['a[href]', ['tag-anchor', 'nofollow-anchor']], + [':not(*)', []], + ['a:not([href])', ['name-anchor']], + ['ol :Not(li[class])', ['first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li']], // HTML-specific - array(':link', array('link-href', 'tag-anchor', 'nofollow-anchor', 'area-href')), - array(':visited', array()), - array(':enabled', array('link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href')), - array(':disabled', array('checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled')), - array(':checked', array('checkbox-checked', 'checkbox-disabled-checked')), - ); + [':link', ['link-href', 'tag-anchor', 'nofollow-anchor', 'area-href']], + [':visited', []], + [':enabled', ['link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href']], + [':disabled', ['checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled']], + [':checked', ['checkbox-checked', 'checkbox-disabled-checked']], + ]; } public function getHtmlShakespearTestData() { - return array( - array('*', 246), - array('div:contains(CELIA)', 26), - array('div:only-child', 22), // ? - array('div:nth-child(even)', 106), - array('div:nth-child(2n)', 106), - array('div:nth-child(odd)', 137), - array('div:nth-child(2n+1)', 137), - array('div:nth-child(n)', 243), - array('div:last-child', 53), - array('div:first-child', 51), - array('div > div', 242), - array('div + div', 190), - array('div ~ div', 190), - array('body', 1), - array('body div', 243), - array('div', 243), - array('div div', 242), - array('div div div', 241), - array('div, div, div', 243), - array('div, a, span', 243), - array('.dialog', 51), - array('div.dialog', 51), - array('div .dialog', 51), - array('div.character, div.dialog', 99), - array('div.direction.dialog', 0), - array('div.dialog.direction', 0), - array('div.dialog.scene', 1), - array('div.scene.scene', 1), - array('div.scene .scene', 0), - array('div.direction .dialog ', 0), - array('div .dialog .direction', 4), - array('div.dialog .dialog .direction', 4), - array('#speech5', 1), - array('div#speech5', 1), - array('div #speech5', 1), - array('div.scene div.dialog', 49), - array('div#scene1 div.dialog div', 142), - array('#scene1 #speech1', 1), - array('div[class]', 103), - array('div[class=dialog]', 50), - array('div[class^=dia]', 51), - array('div[class$=log]', 50), - array('div[class*=sce]', 1), - array('div[class|=dialog]', 50), // ? Seems right - array('div[class!=madeup]', 243), // ? Seems right - array('div[class~=dialog]', 51), // ? Seems right - ); + return [ + ['*', 246], + ['div:contains(CELIA)', 26], + ['div:only-child', 22], // ? + ['div:nth-child(even)', 106], + ['div:nth-child(2n)', 106], + ['div:nth-child(odd)', 137], + ['div:nth-child(2n+1)', 137], + ['div:nth-child(n)', 243], + ['div:last-child', 53], + ['div:first-child', 51], + ['div > div', 242], + ['div + div', 190], + ['div ~ div', 190], + ['body', 1], + ['body div', 243], + ['div', 243], + ['div div', 242], + ['div div div', 241], + ['div, div, div', 243], + ['div, a, span', 243], + ['.dialog', 51], + ['div.dialog', 51], + ['div .dialog', 51], + ['div.character, div.dialog', 99], + ['div.direction.dialog', 0], + ['div.dialog.direction', 0], + ['div.dialog.scene', 1], + ['div.scene.scene', 1], + ['div.scene .scene', 0], + ['div.direction .dialog ', 0], + ['div .dialog .direction', 4], + ['div.dialog .dialog .direction', 4], + ['#speech5', 1], + ['div#speech5', 1], + ['div #speech5', 1], + ['div.scene div.dialog', 49], + ['div#scene1 div.dialog div', 142], + ['#scene1 #speech1', 1], + ['div[class]', 103], + ['div[class=dialog]', 50], + ['div[class^=dia]', 51], + ['div[class$=log]', 50], + ['div[class*=sce]', 1], + ['div[class|=dialog]', 50], // ? Seems right + ['div[class!=madeup]', 243], // ? Seems right + ['div[class~=dialog]', 51], // ? Seems right + ]; } } diff --git a/application/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php index 026ac06..1dce1ed 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php @@ -28,7 +28,7 @@ abstract class AbstractExtension implements ExtensionInterface */ public function getNodeTranslators() { - return array(); + return []; } /** @@ -36,7 +36,7 @@ public function getNodeTranslators() */ public function getCombinationTranslators() { - return array(); + return []; } /** @@ -44,7 +44,7 @@ public function getCombinationTranslators() */ public function getFunctionTranslators() { - return array(); + return []; } /** @@ -52,7 +52,7 @@ public function getFunctionTranslators() */ public function getPseudoClassTranslators() { - return array(); + return []; } /** @@ -60,6 +60,6 @@ public function getPseudoClassTranslators() */ public function getAttributeMatchingTranslators() { - return array(); + return []; } } diff --git a/application/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php index 2078dca..f27878b 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php @@ -31,22 +31,21 @@ class AttributeMatchingExtension extends AbstractExtension */ public function getAttributeMatchingTranslators() { - return array( - 'exists' => array($this, 'translateExists'), - '=' => array($this, 'translateEquals'), - '~=' => array($this, 'translateIncludes'), - '|=' => array($this, 'translateDashMatch'), - '^=' => array($this, 'translatePrefixMatch'), - '$=' => array($this, 'translateSuffixMatch'), - '*=' => array($this, 'translateSubstringMatch'), - '!=' => array($this, 'translateDifferent'), - ); + return [ + 'exists' => [$this, 'translateExists'], + '=' => [$this, 'translateEquals'], + '~=' => [$this, 'translateIncludes'], + '|=' => [$this, 'translateDashMatch'], + '^=' => [$this, 'translatePrefixMatch'], + '$=' => [$this, 'translateSuffixMatch'], + '*=' => [$this, 'translateSubstringMatch'], + '!=' => [$this, 'translateDifferent'], + ]; } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -56,9 +55,8 @@ public function translateExists(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -68,9 +66,8 @@ public function translateEquals(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -84,9 +81,8 @@ public function translateIncludes(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -101,9 +97,8 @@ public function translateDashMatch(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -117,9 +112,8 @@ public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -134,9 +128,8 @@ public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ @@ -150,9 +143,8 @@ public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value) } /** - * @param XPathExpr $xpath - * @param string $attribute - * @param string $value + * @param string $attribute + * @param string $value * * @return XPathExpr */ diff --git a/application/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php index 0c9cc03..d962dc5 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php @@ -30,12 +30,12 @@ class CombinationExtension extends AbstractExtension */ public function getCombinationTranslators() { - return array( - ' ' => array($this, 'translateDescendant'), - '>' => array($this, 'translateChild'), - '+' => array($this, 'translateDirectAdjacent'), - '~' => array($this, 'translateIndirectAdjacent'), - ); + return [ + ' ' => [$this, 'translateDescendant'], + '>' => [$this, 'translateChild'], + '+' => [$this, 'translateDirectAdjacent'], + '~' => [$this, 'translateIndirectAdjacent'], + ]; } /** diff --git a/application/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php index 4d34d0e..a121ab8 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php @@ -35,21 +35,19 @@ class FunctionExtension extends AbstractExtension */ public function getFunctionTranslators() { - return array( - 'nth-child' => array($this, 'translateNthChild'), - 'nth-last-child' => array($this, 'translateNthLastChild'), - 'nth-of-type' => array($this, 'translateNthOfType'), - 'nth-last-of-type' => array($this, 'translateNthLastOfType'), - 'contains' => array($this, 'translateContains'), - 'lang' => array($this, 'translateLang'), - ); + return [ + 'nth-child' => [$this, 'translateNthChild'], + 'nth-last-child' => [$this, 'translateNthLastChild'], + 'nth-of-type' => [$this, 'translateNthOfType'], + 'nth-last-of-type' => [$this, 'translateNthLastOfType'], + 'contains' => [$this, 'translateContains'], + 'lang' => [$this, 'translateLang'], + ]; } /** - * @param XPathExpr $xpath - * @param FunctionNode $function - * @param bool $last - * @param bool $addNameTest + * @param bool $last + * @param bool $addNameTest * * @return XPathExpr * @@ -60,7 +58,7 @@ public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $las try { list($a, $b) = Parser::parseSeries($function->getArguments()); } catch (SyntaxErrorException $e) { - throw new ExpressionErrorException(sprintf('Invalid series: %s', implode(', ', $function->getArguments())), 0, $e); + throw new ExpressionErrorException(sprintf('Invalid series: "%s".', implode('", "', $function->getArguments())), 0, $e); } $xpath->addStarPrefix(); @@ -93,7 +91,7 @@ public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $las $expr .= ' - '.$b; } - $conditions = array(sprintf('%s %s 0', $expr, $sign)); + $conditions = [sprintf('%s %s 0', $expr, $sign)]; if (1 !== $a && -1 !== $a) { $conditions[] = sprintf('(%s) mod %d = 0', $expr, $a); diff --git a/application/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php index cd8e0d5..99c1166 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php @@ -41,16 +41,16 @@ public function __construct(Translator $translator) */ public function getPseudoClassTranslators() { - return array( - 'checked' => array($this, 'translateChecked'), - 'link' => array($this, 'translateLink'), - 'disabled' => array($this, 'translateDisabled'), - 'enabled' => array($this, 'translateEnabled'), - 'selected' => array($this, 'translateSelected'), - 'invalid' => array($this, 'translateInvalid'), - 'hover' => array($this, 'translateHover'), - 'visited' => array($this, 'translateVisited'), - ); + return [ + 'checked' => [$this, 'translateChecked'], + 'link' => [$this, 'translateLink'], + 'disabled' => [$this, 'translateDisabled'], + 'enabled' => [$this, 'translateEnabled'], + 'selected' => [$this, 'translateSelected'], + 'invalid' => [$this, 'translateInvalid'], + 'hover' => [$this, 'translateHover'], + 'visited' => [$this, 'translateVisited'], + ]; } /** @@ -58,9 +58,9 @@ public function getPseudoClassTranslators() */ public function getFunctionTranslators() { - return array( - 'lang' => array($this, 'translateLang'), - ); + return [ + 'lang' => [$this, 'translateLang'], + ]; } /** diff --git a/application/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php index 715d961..de222af 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php @@ -75,17 +75,17 @@ public function hasFlag($flag) */ public function getNodeTranslators() { - return array( - 'Selector' => array($this, 'translateSelector'), - 'CombinedSelector' => array($this, 'translateCombinedSelector'), - 'Negation' => array($this, 'translateNegation'), - 'Function' => array($this, 'translateFunction'), - 'Pseudo' => array($this, 'translatePseudo'), - 'Attribute' => array($this, 'translateAttribute'), - 'Class' => array($this, 'translateClass'), - 'Hash' => array($this, 'translateHash'), - 'Element' => array($this, 'translateElement'), - ); + return [ + 'Selector' => [$this, 'translateSelector'], + 'CombinedSelector' => [$this, 'translateCombinedSelector'], + 'Negation' => [$this, 'translateNegation'], + 'Function' => [$this, 'translateFunction'], + 'Pseudo' => [$this, 'translatePseudo'], + 'Attribute' => [$this, 'translateAttribute'], + 'Class' => [$this, 'translateClass'], + 'Hash' => [$this, 'translateHash'], + 'Element' => [$this, 'translateElement'], + ]; } /** diff --git a/application/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php b/application/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php index 378dfb7..288a9e6 100644 --- a/application/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php +++ b/application/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php @@ -31,16 +31,16 @@ class PseudoClassExtension extends AbstractExtension */ public function getPseudoClassTranslators() { - return array( - 'root' => array($this, 'translateRoot'), - 'first-child' => array($this, 'translateFirstChild'), - 'last-child' => array($this, 'translateLastChild'), - 'first-of-type' => array($this, 'translateFirstOfType'), - 'last-of-type' => array($this, 'translateLastOfType'), - 'only-child' => array($this, 'translateOnlyChild'), - 'only-of-type' => array($this, 'translateOnlyOfType'), - 'empty' => array($this, 'translateEmpty'), - ); + return [ + 'root' => [$this, 'translateRoot'], + 'first-child' => [$this, 'translateFirstChild'], + 'last-child' => [$this, 'translateLastChild'], + 'first-of-type' => [$this, 'translateFirstOfType'], + 'last-of-type' => [$this, 'translateLastOfType'], + 'only-child' => [$this, 'translateOnlyChild'], + 'only-of-type' => [$this, 'translateOnlyOfType'], + 'empty' => [$this, 'translateEmpty'], + ]; } /** @@ -123,11 +123,13 @@ public function translateOnlyChild(XPathExpr $xpath) */ public function translateOnlyOfType(XPathExpr $xpath) { - if ('*' === $xpath->getElement()) { + $element = $xpath->getElement(); + + if ('*' === $element) { throw new ExpressionErrorException('"*:only-of-type" is not implemented.'); } - return $xpath->addCondition('last() = 1'); + return $xpath->addCondition(sprintf('count(preceding-sibling::%s)=0 and count(following-sibling::%s)=0', $element, $element)); } /** diff --git a/application/vendor/symfony/css-selector/XPath/Translator.php b/application/vendor/symfony/css-selector/XPath/Translator.php index f8585a0..7388860 100644 --- a/application/vendor/symfony/css-selector/XPath/Translator.php +++ b/application/vendor/symfony/css-selector/XPath/Translator.php @@ -35,18 +35,18 @@ class Translator implements TranslatorInterface /** * @var ParserInterface[] */ - private $shortcutParsers = array(); + private $shortcutParsers = []; /** * @var Extension\ExtensionInterface[] */ - private $extensions = array(); + private $extensions = []; - private $nodeTranslators = array(); - private $combinationTranslators = array(); - private $functionTranslators = array(); - private $pseudoClassTranslators = array(); - private $attributeMatchingTranslators = array(); + private $nodeTranslators = []; + private $combinationTranslators = []; + private $functionTranslators = []; + private $pseudoClassTranslators = []; + private $attributeMatchingTranslators = []; public function __construct(ParserInterface $parser = null) { @@ -77,7 +77,7 @@ public static function getXpathLiteral($element) } $string = $element; - $parts = array(); + $parts = []; while (true) { if (false !== $pos = strpos($string, "'")) { $parts[] = sprintf("'%s'", substr($string, 0, $pos)); @@ -180,9 +180,7 @@ public function nodeToXPath(NodeInterface $node) } /** - * @param string $combiner - * @param NodeInterface $xpath - * @param NodeInterface $combinedXpath + * @param string $combiner * * @return XPathExpr * @@ -212,8 +210,7 @@ public function addFunction(XPathExpr $xpath, FunctionNode $function) } /** - * @param XPathExpr $xpath - * @param string $pseudoClass + * @param string $pseudoClass * * @return XPathExpr * @@ -229,10 +226,9 @@ public function addPseudoClass(XPathExpr $xpath, $pseudoClass) } /** - * @param XPathExpr $xpath - * @param string $operator - * @param string $attribute - * @param string $value + * @param string $operator + * @param string $attribute + * @param string $value * * @return XPathExpr * diff --git a/application/vendor/symfony/css-selector/XPath/TranslatorInterface.php b/application/vendor/symfony/css-selector/XPath/TranslatorInterface.php index 0b5de83..fdbdf22 100644 --- a/application/vendor/symfony/css-selector/XPath/TranslatorInterface.php +++ b/application/vendor/symfony/css-selector/XPath/TranslatorInterface.php @@ -38,8 +38,7 @@ public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::'); /** * Translates a parsed selector node to an XPath expression. * - * @param SelectorNode $selector - * @param string $prefix + * @param string $prefix * * @return string */ diff --git a/application/vendor/symfony/css-selector/XPath/XPathExpr.php b/application/vendor/symfony/css-selector/XPath/XPathExpr.php index 63e3ac3..a1e244c 100644 --- a/application/vendor/symfony/css-selector/XPath/XPathExpr.php +++ b/application/vendor/symfony/css-selector/XPath/XPathExpr.php @@ -53,8 +53,6 @@ public function getElement() } /** - * @param $condition - * * @return $this */ public function addCondition($condition) diff --git a/application/vendor/symfony/css-selector/composer.json b/application/vendor/symfony/css-selector/composer.json index e5bbdcc..435063f 100644 --- a/application/vendor/symfony/css-selector/composer.json +++ b/application/vendor/symfony/css-selector/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=5.3.9" + "php": "^5.5.9|>=7.0.8" }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, @@ -28,10 +28,5 @@ "/Tests/" ] }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - } + "minimum-stability": "dev" } diff --git a/application/vendor/symfony/debug/BufferingLogger.php b/application/vendor/symfony/debug/BufferingLogger.php new file mode 100644 index 0000000..a2ed75b --- /dev/null +++ b/application/vendor/symfony/debug/BufferingLogger.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Debug; + +use Psr\Log\AbstractLogger; + +/** + * A buffering logger that stacks logs for later. + * + * @author Nicolas Grekas + */ +class BufferingLogger extends AbstractLogger +{ + private $logs = array(); + + public function log($level, $message, array $context = array()) + { + $this->logs[] = array($level, $message, $context); + } + + public function cleanLogs() + { + $logs = $this->logs; + $this->logs = array(); + + return $logs; + } +} diff --git a/application/vendor/symfony/debug/CHANGELOG.md b/application/vendor/symfony/debug/CHANGELOG.md index 31f0de9..c81bccf 100644 --- a/application/vendor/symfony/debug/CHANGELOG.md +++ b/application/vendor/symfony/debug/CHANGELOG.md @@ -1,6 +1,18 @@ CHANGELOG ========= +3.0.0 +----- + +* removed classes, methods and interfaces deprecated in 2.x + +2.8.0 +----- + +* added BufferingLogger for errors that happen before a proper logger is configured +* allow throwing from `__toString()` with `return trigger_error($e, E_USER_ERROR);` +* deprecate ExceptionHandler::createResponse + 2.7.0 ----- diff --git a/application/vendor/symfony/debug/Debug.php b/application/vendor/symfony/debug/Debug.php index 9ae3496..e3665ae 100644 --- a/application/vendor/symfony/debug/Debug.php +++ b/application/vendor/symfony/debug/Debug.php @@ -31,7 +31,7 @@ class Debug * @param int $errorReportingLevel The level of error reporting you want * @param bool $displayErrors Whether to display errors (for development) or just log them (for production) */ - public static function enable($errorReportingLevel = null, $displayErrors = true) + public static function enable($errorReportingLevel = E_ALL, $displayErrors = true) { if (static::$enabled) { return; @@ -42,19 +42,20 @@ public static function enable($errorReportingLevel = null, $displayErrors = true if (null !== $errorReportingLevel) { error_reporting($errorReportingLevel); } else { - error_reporting(-1); + error_reporting(E_ALL); } - if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) { + if ('cli' !== PHP_SAPI) { ini_set('display_errors', 0); ExceptionHandler::register(); } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) { // CLI - display errors only if they're not already logged to STDERR ini_set('display_errors', 1); } - $handler = ErrorHandler::register(); - if (!$displayErrors) { - $handler->throwAt(0, true); + if ($displayErrors) { + ErrorHandler::register(new ErrorHandler(new BufferingLogger())); + } else { + ErrorHandler::register()->throwAt(0, true); } DebugClassLoader::enable(); diff --git a/application/vendor/symfony/debug/DebugClassLoader.php b/application/vendor/symfony/debug/DebugClassLoader.php index c34605c..9fd6887 100644 --- a/application/vendor/symfony/debug/DebugClassLoader.php +++ b/application/vendor/symfony/debug/DebugClassLoader.php @@ -26,28 +26,20 @@ class DebugClassLoader { private $classLoader; private $isFinder; - private $loaded = array(); - private $wasFinder; private static $caseCheck; private static $deprecated = array(); private static $php7Reserved = array('int', 'float', 'bool', 'string', 'true', 'false', 'null'); private static $darwinCache = array('/' => array('/', array())); /** - * @param callable|object $classLoader Passing an object is @deprecated since version 2.5 and support for it will be removed in 3.0 + * Constructor. + * + * @param callable $classLoader A class loader */ - public function __construct($classLoader) + public function __construct(callable $classLoader) { - $this->wasFinder = is_object($classLoader) && method_exists($classLoader, 'findFile'); - - if ($this->wasFinder) { - @trigger_error('The '.__METHOD__.' method will no longer support receiving an object into its $classLoader argument in 3.0.', E_USER_DEPRECATED); - $this->classLoader = array($classLoader, 'loadClass'); - $this->isFinder = true; - } else { - $this->classLoader = $classLoader; - $this->isFinder = is_array($classLoader) && method_exists($classLoader[0], 'findFile'); - } + $this->classLoader = $classLoader; + $this->isFinder = is_array($classLoader) && method_exists($classLoader[0], 'findFile'); if (!isset(self::$caseCheck)) { $file = file_exists(__FILE__) ? __FILE__ : rtrim(realpath('.'), DIRECTORY_SEPARATOR); @@ -76,11 +68,11 @@ public function __construct($classLoader) /** * Gets the wrapped class loader. * - * @return callable|object A class loader. Since version 2.5, returning an object is @deprecated and support for it will be removed in 3.0 + * @return callable The wrapped class loader */ public function getClassLoader() { - return $this->wasFinder ? $this->classLoader[0] : $this->classLoader; + return $this->classLoader; } /** @@ -131,24 +123,6 @@ public static function disable() } } - /** - * Finds a file by class name. - * - * @param string $class A class name to resolve to file - * - * @return string|null - * - * @deprecated since version 2.5, to be removed in 3.0. - */ - public function findFile($class) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - - if ($this->wasFinder) { - return $this->classLoader[0]->findFile($class); - } - } - /** * Loads the given class or interface. * @@ -163,30 +137,21 @@ public function loadClass($class) ErrorHandler::stackErrors(); try { - if ($this->isFinder && !isset($this->loaded[$class])) { - $this->loaded[$class] = true; + if ($this->isFinder) { if ($file = $this->classLoader[0]->findFile($class)) { - require $file; + require_once $file; } } else { call_user_func($this->classLoader, $class); $file = false; } - } catch (\Exception $e) { + } finally { ErrorHandler::unstackErrors(); - - throw $e; - } catch (\Throwable $e) { - ErrorHandler::unstackErrors(); - - throw $e; } - ErrorHandler::unstackErrors(); + $exists = class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); - $exists = class_exists($class, false) || interface_exists($class, false) || (function_exists('trait_exists') && trait_exists($class, false)); - - if ($class && '\\' === $class[0]) { + if ('\\' === $class[0]) { $class = substr($class, 1); } @@ -203,11 +168,18 @@ public function loadClass($class) } elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) { self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]); } else { - if (2 > $len = 1 + (strpos($name, '\\') ?: strpos($name, '_'))) { + if (2 > $len = 1 + (strpos($name, '\\', 1 + strpos($name, '\\')) ?: strpos($name, '_'))) { $len = 0; $ns = ''; } else { - $ns = substr($name, 0, $len); + switch ($ns = substr($name, 0, $len)) { + case 'Symfony\Bridge\\': + case 'Symfony\Bundle\\': + case 'Symfony\Component\\': + $ns = 'Symfony\\'; + $len = strlen($ns); + break; + } } $parent = get_parent_class($class); @@ -216,9 +188,26 @@ public function loadClass($class) @trigger_error(sprintf('The %s class extends %s that is deprecated %s', $name, $parent, self::$deprecated[$parent]), E_USER_DEPRECATED); } - foreach (class_implements($class) as $interface) { - if (isset(self::$deprecated[$interface]) && strncmp($ns, $interface, $len) && !is_subclass_of($parent, $interface)) { - @trigger_error(sprintf('The %s %s %s that is deprecated %s', $name, interface_exists($class) ? 'interface extends' : 'class implements', $interface, self::$deprecated[$interface]), E_USER_DEPRECATED); + $parentInterfaces = array(); + $deprecatedInterfaces = array(); + if ($parent) { + foreach (class_implements($parent) as $interface) { + $parentInterfaces[$interface] = 1; + } + } + + foreach ($refl->getInterfaceNames() as $interface) { + if (isset(self::$deprecated[$interface]) && strncmp($ns, $interface, $len)) { + $deprecatedInterfaces[] = $interface; + } + foreach (class_implements($interface) as $interface) { + $parentInterfaces[$interface] = 1; + } + } + + foreach ($deprecatedInterfaces as $interface) { + if (!isset($parentInterfaces[$interface])) { + @trigger_error(sprintf('The %s %s %s that is deprecated %s', $name, $refl->isInterface() ? 'interface extends' : 'class implements', $interface, self::$deprecated[$interface]), E_USER_DEPRECATED); } } } diff --git a/application/vendor/symfony/debug/ErrorHandler.php b/application/vendor/symfony/debug/ErrorHandler.php index 4671b85..04fba93 100644 --- a/application/vendor/symfony/debug/ErrorHandler.php +++ b/application/vendor/symfony/debug/ErrorHandler.php @@ -46,11 +46,6 @@ */ class ErrorHandler { - /** - * @deprecated since version 2.6, to be removed in 3.0. - */ - const TYPE_DEPRECATION = -100; - private $levels = array( E_DEPRECATED => 'Deprecated', E_USER_DEPRECATED => 'User Deprecated', @@ -97,42 +92,29 @@ class ErrorHandler private $isRecursive = 0; private $isRoot = false; private $exceptionHandler; + private $bootstrappingLogger; private static $reservedMemory; private static $stackedErrors = array(); private static $stackedErrorLevels = array(); - private static $exitCode = 0; - - /** - * Same init value as thrownErrors. - * - * @deprecated since version 2.6, to be removed in 3.0. - */ - private $displayErrors = 0x1FFF; + private static $toStringException = null; /** * Registers the error handler. * - * @param self|null|int $handler The handler to register, or @deprecated (since version 2.6, to be removed in 3.0) bit field of thrown levels - * @param bool $replace Whether to replace or not any existing handler + * @param self|null $handler The handler to register + * @param bool $replace Whether to replace or not any existing handler * * @return self The registered error handler */ - public static function register($handler = null, $replace = true) + public static function register(self $handler = null, $replace = true) { if (null === self::$reservedMemory) { self::$reservedMemory = str_repeat('x', 10240); register_shutdown_function(__CLASS__.'::handleFatalError'); } - $levels = -1; - - if ($handlerIsNew = !$handler instanceof self) { - // @deprecated polymorphism, to be removed in 3.0 - if (null !== $handler) { - $levels = $replace ? $handler : 0; - $replace = true; - } + if ($handlerIsNew = null === $handler) { $handler = new static(); } @@ -147,31 +129,25 @@ public static function register($handler = null, $replace = true) $handler = $prev[0]; $replace = false; } - if (!$replace && $prev) { - restore_error_handler(); - $handlerIsRegistered = is_array($prev) && $handler === $prev[0]; - } else { - $handlerIsRegistered = true; - } - if (is_array($prev = set_exception_handler(array($handler, 'handleException'))) && $prev[0] instanceof self) { - restore_exception_handler(); - if (!$handlerIsRegistered) { - $handler = $prev[0]; - } elseif ($handler !== $prev[0] && $replace) { - set_exception_handler(array($handler, 'handleException')); - $p = $prev[0]->setExceptionHandler(null); - $handler->setExceptionHandler($p); - $prev[0]->setExceptionHandler($p); - } + if ($replace || !$prev) { + $handler->setExceptionHandler(set_exception_handler(array($handler, 'handleException'))); } else { - $handler->setExceptionHandler($prev); + restore_error_handler(); } - $handler->throwAt($levels & $handler->thrownErrors, true); + $handler->throwAt(E_ALL & $handler->thrownErrors, true); return $handler; } + public function __construct(BufferingLogger $bootstrappingLogger = null) + { + if ($bootstrappingLogger) { + $this->bootstrappingLogger = $bootstrappingLogger; + $this->setDefaultLogger($bootstrappingLogger); + } + } + /** * Sets a logger to non assigned errors levels. * @@ -179,22 +155,22 @@ public static function register($handler = null, $replace = true) * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants * @param bool $replace Whether to replace or not any existing logger */ - public function setDefaultLogger(LoggerInterface $logger, $levels = null, $replace = false) + public function setDefaultLogger(LoggerInterface $logger, $levels = E_ALL, $replace = false) { $loggers = array(); if (is_array($levels)) { foreach ($levels as $type => $logLevel) { - if (empty($this->loggers[$type][0]) || $replace) { + if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) { $loggers[$type] = array($logger, $logLevel); } } } else { if (null === $levels) { - $levels = E_ALL | E_STRICT; + $levels = E_ALL; } foreach ($this->loggers as $type => $log) { - if (($type & $levels) && (empty($log[0]) || $replace)) { + if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) { $log[0] = $logger; $loggers[$type] = $log; } @@ -217,6 +193,7 @@ public function setLoggers(array $loggers) { $prevLogged = $this->loggedErrors; $prev = $this->loggers; + $flush = array(); foreach ($loggers as $type => $log) { if (!isset($prev[$type])) { @@ -235,9 +212,24 @@ public function setLoggers(array $loggers) throw new \InvalidArgumentException('Invalid logger provided'); } $this->loggers[$type] = $log + $prev[$type]; + + if ($this->bootstrappingLogger && $prev[$type][0] === $this->bootstrappingLogger) { + $flush[$type] = $type; + } } $this->reRegister($prevLogged | $this->thrownErrors); + if ($flush) { + foreach ($this->bootstrappingLogger->cleanLogs() as $log) { + $type = $log[2]['type']; + if (!isset($flush[$type])) { + $this->bootstrappingLogger->log($log[0], $log[1], $log[2]); + } elseif ($this->loggers[$type][0]) { + $this->loggers[$type][0]->log($this->loggers[$type][1], $log[1], $log[2]); + } + } + } + return $prev; } @@ -247,14 +239,9 @@ public function setLoggers(array $loggers) * @param callable $handler A handler that will be called on Exception * * @return callable|null The previous exception handler - * - * @throws \InvalidArgumentException */ - public function setExceptionHandler($handler) + public function setExceptionHandler(callable $handler = null) { - if (null !== $handler && !is_callable($handler)) { - throw new \LogicException('The exception handler must be a valid PHP callable.'); - } $prev = $this->exceptionHandler; $this->exceptionHandler = $handler; @@ -278,9 +265,6 @@ public function throwAt($levels, $replace = false) } $this->reRegister($prev | $this->loggedErrors); - // $this->displayErrors is @deprecated since version 2.6 - $this->displayErrors = $this->thrownErrors; - return $prev; } @@ -365,9 +349,9 @@ private function reRegister($prev) * Handles errors by filtering then logging them according to the configured bit fields. * * @param int $type One of the E_* constants - * @param string $message * @param string $file * @param int $line + * @param array $context * * @return bool Returns false when no handling happens so that the PHP engine can handle the error itself * @@ -375,32 +359,15 @@ private function reRegister($prev) * * @internal */ - public function handleError($type, $message, $file, $line) + public function handleError($type, $message, $file, $line, array $context, array $backtrace = null) { - $level = error_reporting(); - $silenced = 0 === ($level & $type); - $level |= E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED; + $level = error_reporting() | E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED; $log = $this->loggedErrors & $type; $throw = $this->thrownErrors & $type & $level; $type &= $level | $this->screamedErrors; if (!$type || (!$log && !$throw)) { - return !$silenced && $type && $log; - } - $scope = $this->scopedErrors & $type; - - if (4 < $numArgs = func_num_args()) { - $context = $scope ? (func_get_arg(4) ?: array()) : array(); - $backtrace = 5 < $numArgs ? func_get_arg(5) : null; // defined on HHVM - } else { - $context = array(); - $backtrace = null; - } - - if (isset($context['GLOBALS']) && $scope) { - $e = $context; // Whatever the signature of the method, - unset($e['GLOBALS'], $context); // $context is always a reference in 5.3 - $context = $e; + return $type && $log; } if (null !== $backtrace && $type & E_ERROR) { @@ -413,19 +380,54 @@ public function handleError($type, $message, $file, $line) } if ($throw) { - if ($scope && class_exists('Symfony\Component\Debug\Exception\ContextErrorException')) { - // Checking for class existence is a work around for https://bugs.php.net/42098 + if (null !== self::$toStringException) { + $throw = self::$toStringException; + self::$toStringException = null; + } elseif (($this->scopedErrors & $type) && class_exists(ContextErrorException::class)) { $throw = new ContextErrorException($this->levels[$type].': '.$message, 0, $type, $file, $line, $context); } else { $throw = new \ErrorException($this->levels[$type].': '.$message, 0, $type, $file, $line); } - if (\PHP_VERSION_ID <= 50407 && (\PHP_VERSION_ID >= 50400 || \PHP_VERSION_ID <= 50317)) { - // Exceptions thrown from error handlers are sometimes not caught by the exception - // handler and shutdown handlers are bypassed before 5.4.8/5.3.18. - // We temporarily re-enable display_errors to prevent any blank page related to this bug. - - $throw->errorHandlerCanary = new ErrorHandlerCanary(); + if (E_USER_ERROR & $type) { + $backtrace = $backtrace ?: $throw->getTrace(); + + for ($i = 1; isset($backtrace[$i]); ++$i) { + if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function']) + && '__toString' === $backtrace[$i]['function'] + && '->' === $backtrace[$i]['type'] + && !isset($backtrace[$i - 1]['class']) + && ('trigger_error' === $backtrace[$i - 1]['function'] || 'user_error' === $backtrace[$i - 1]['function']) + ) { + // Here, we know trigger_error() has been called from __toString(). + // HHVM is fine with throwing from __toString() but PHP triggers a fatal error instead. + // A small convention allows working around the limitation: + // given a caught $e exception in __toString(), quitting the method with + // `return trigger_error($e, E_USER_ERROR);` allows this error handler + // to make $e get through the __toString() barrier. + + foreach ($context as $e) { + if (($e instanceof \Exception || $e instanceof \Throwable) && $e->__toString() === $message) { + if (1 === $i) { + // On HHVM + $throw = $e; + break; + } + self::$toStringException = $e; + + return true; + } + } + + if (1 < $i) { + // On PHP (not on HHVM), display the original error message instead of the default one. + $this->handleException($throw); + + // Stop the process by giving back the error to the native handler. + return false; + } + } + } } throw $throw; @@ -444,7 +446,7 @@ public function handleError($type, $message, $file, $line) $e = compact('type', 'file', 'line', 'level'); if ($type & $level) { - if ($scope) { + if ($this->scopedErrors & $type) { $e['scope_vars'] = $context; if ($trace) { $e['stack'] = $backtrace ?: debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT); @@ -469,19 +471,12 @@ public function handleError($type, $message, $file, $line) try { $this->isRecursive = true; $this->loggers[$type][0]->log(($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG, $message, $e); + } finally { $this->isRecursive = false; - } catch (\Exception $e) { - $this->isRecursive = false; - - throw $e; - } catch (\Throwable $e) { - $this->isRecursive = false; - - throw $e; } } - return !$silenced && $type && $log; + return $type && $log; } /** @@ -494,14 +489,10 @@ public function handleError($type, $message, $file, $line) */ public function handleException($exception, array $error = null) { - if (null === $error) { - self::$exitCode = 255; - } if (!$exception instanceof \Exception) { $exception = new FatalThrowableError($exception); } $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR; - $handlerException = null; if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) { $e = array( @@ -532,11 +523,7 @@ public function handleException($exception, array $error = null) } } if ($this->loggedErrors & $type) { - try { - $this->loggers[$type][0]->log($this->loggers[$type][1], $message, $e); - } catch (\Exception $handlerException) { - } catch (\Throwable $handlerException) { - } + $this->loggers[$type][0]->log($this->loggers[$type][1], $message, $e); } if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) { foreach ($this->getFatalErrorHandlers() as $handler) { @@ -546,21 +533,18 @@ public function handleException($exception, array $error = null) } } } - $exceptionHandler = $this->exceptionHandler; - $this->exceptionHandler = null; + if (empty($this->exceptionHandler)) { + throw $exception; // Give back $exception to the native handler + } try { - if (null !== $exceptionHandler) { - return \call_user_func($exceptionHandler, $exception); - } - $handlerException = $handlerException ?: $exception; + call_user_func($this->exceptionHandler, $exception); } catch (\Exception $handlerException) { } catch (\Throwable $handlerException) { } - if ($exception === $handlerException) { - self::$reservedMemory = null; // Disable the fatal error handler - throw $exception; // Give back $exception to the native handler + if (isset($handlerException)) { + $this->exceptionHandler = null; + $this->handleException($handlerException); } - $this->handleException($handlerException); } /** @@ -576,41 +560,17 @@ public static function handleFatalError(array $error = null) return; } - $handler = self::$reservedMemory = null; - $handlers = array(); - $previousHandler = null; - $sameHandlerLimit = 10; + self::$reservedMemory = null; - while (!is_array($handler) || !$handler[0] instanceof self) { - $handler = set_exception_handler('var_dump'); - restore_exception_handler(); + $handler = set_error_handler('var_dump'); + $handler = is_array($handler) ? $handler[0] : null; + restore_error_handler(); - if (!$handler) { - break; - } - restore_exception_handler(); - - if ($handler !== $previousHandler) { - array_unshift($handlers, $handler); - $previousHandler = $handler; - } elseif (0 === --$sameHandlerLimit) { - $handler = null; - break; - } - } - foreach ($handlers as $h) { - set_exception_handler($h); - } - if (!$handler) { + if (!$handler instanceof self) { return; } - if ($handler !== $h) { - $handler[0]->setExceptionHandler($h); - } - $handler = $handler[0]; - $handlers = array(); - if ($exit = null === $error) { + if (null === $error) { $error = error_get_last(); } @@ -634,21 +594,15 @@ public static function handleFatalError(array $error = null) } else { $exception = new FatalErrorException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, true, $trace); } + } elseif (!isset($exception)) { + return; } try { - if (isset($exception)) { - self::$exitCode = 255; - $handler->handleException($exception, $error); - } + $handler->handleException($exception, $error); } catch (FatalErrorException $e) { // Ignore this re-throw } - - if ($exit && self::$exitCode) { - $exitCode = self::$exitCode; - register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); }); - } } /** @@ -707,118 +661,4 @@ protected function getFatalErrorHandlers() new ClassNotFoundFatalErrorHandler(), ); } - - /** - * Sets the level at which the conversion to Exception is done. - * - * @param int|null $level The level (null to use the error_reporting() value and 0 to disable) - * - * @deprecated since version 2.6, to be removed in 3.0. Use throwAt() instead. - */ - public function setLevel($level) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the throwAt() method instead.', E_USER_DEPRECATED); - - $level = null === $level ? error_reporting() : $level; - $this->throwAt($level, true); - } - - /** - * Sets the display_errors flag value. - * - * @param int $displayErrors The display_errors flag value - * - * @deprecated since version 2.6, to be removed in 3.0. Use throwAt() instead. - */ - public function setDisplayErrors($displayErrors) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the throwAt() method instead.', E_USER_DEPRECATED); - - if ($displayErrors) { - $this->throwAt($this->displayErrors, true); - } else { - $displayErrors = $this->displayErrors; - $this->throwAt(0, true); - $this->displayErrors = $displayErrors; - } - } - - /** - * Sets a logger for the given channel. - * - * @param LoggerInterface $logger A logger interface - * @param string $channel The channel associated with the logger (deprecation, emergency or scream) - * - * @deprecated since version 2.6, to be removed in 3.0. Use setLoggers() or setDefaultLogger() instead. - */ - public static function setLogger(LoggerInterface $logger, $channel = 'deprecation') - { - @trigger_error('The '.__METHOD__.' static method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the setLoggers() or setDefaultLogger() methods instead.', E_USER_DEPRECATED); - - $handler = set_error_handler('var_dump'); - $handler = is_array($handler) ? $handler[0] : null; - restore_error_handler(); - if (!$handler instanceof self) { - return; - } - if ('deprecation' === $channel) { - $handler->setDefaultLogger($logger, E_DEPRECATED | E_USER_DEPRECATED, true); - $handler->screamAt(E_DEPRECATED | E_USER_DEPRECATED); - } elseif ('scream' === $channel) { - $handler->setDefaultLogger($logger, E_ALL | E_STRICT, false); - $handler->screamAt(E_ALL | E_STRICT); - } elseif ('emergency' === $channel) { - $handler->setDefaultLogger($logger, E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR, true); - $handler->screamAt(E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR); - } - } - - /** - * @deprecated since version 2.6, to be removed in 3.0. Use handleError() instead. - */ - public function handle($level, $message, $file = 'unknown', $line = 0, $context = array()) - { - $this->handleError(E_USER_DEPRECATED, 'The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the handleError() method instead.', __FILE__, __LINE__, array()); - - return $this->handleError($level, $message, $file, $line, (array) $context); - } - - /** - * Handles PHP fatal errors. - * - * @deprecated since version 2.6, to be removed in 3.0. Use handleFatalError() instead. - */ - public function handleFatal() - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.6 and will be removed in 3.0. Use the handleFatalError() method instead.', E_USER_DEPRECATED); - - static::handleFatalError(); - } -} - -/** - * Private class used to work around https://bugs.php.net/54275. - * - * @author Nicolas Grekas - * - * @internal - */ -class ErrorHandlerCanary -{ - private static $displayErrors = null; - - public function __construct() - { - if (null === self::$displayErrors) { - self::$displayErrors = ini_set('display_errors', 1); - } - } - - public function __destruct() - { - if (null !== self::$displayErrors) { - ini_set('display_errors', self::$displayErrors); - self::$displayErrors = null; - } - } } diff --git a/application/vendor/symfony/debug/Exception/DummyException.php b/application/vendor/symfony/debug/Exception/DummyException.php deleted file mode 100644 index 1b9082b..0000000 --- a/application/vendor/symfony/debug/Exception/DummyException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Debug\Exception; - -@trigger_error('The '.__NAMESPACE__.'\DummyException class is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - -/** - * @author Fabien Potencier - * - * @deprecated since version 2.5, to be removed in 3.0. - */ -class DummyException extends \ErrorException -{ -} diff --git a/application/vendor/symfony/debug/Exception/FatalErrorException.php b/application/vendor/symfony/debug/Exception/FatalErrorException.php index db2fb43..f24a54e 100644 --- a/application/vendor/symfony/debug/Exception/FatalErrorException.php +++ b/application/vendor/symfony/debug/Exception/FatalErrorException.php @@ -9,31 +9,14 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\HttpKernel\Exception; - -/** - * Fatal Error Exception. - * - * @author Fabien Potencier - * @author Konstanton Myakshin - * @author Nicolas Grekas - * - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. - */ -class FatalErrorException extends \ErrorException -{ -} - namespace Symfony\Component\Debug\Exception; -use Symfony\Component\HttpKernel\Exception\FatalErrorException as LegacyFatalErrorException; - /** * Fatal Error Exception. * * @author Konstanton Myakshin */ -class FatalErrorException extends LegacyFatalErrorException +class FatalErrorException extends \ErrorException { public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true, array $trace = null) { diff --git a/application/vendor/symfony/debug/Exception/FatalThrowableError.php b/application/vendor/symfony/debug/Exception/FatalThrowableError.php index fafc922..34f43b1 100644 --- a/application/vendor/symfony/debug/Exception/FatalThrowableError.php +++ b/application/vendor/symfony/debug/Exception/FatalThrowableError.php @@ -36,8 +36,7 @@ public function __construct(\Throwable $e) $e->getCode(), $severity, $e->getFile(), - $e->getLine(), - $e->getPrevious() + $e->getLine() ); $this->setTrace($e->getTrace()); diff --git a/application/vendor/symfony/debug/Exception/FlattenException.php b/application/vendor/symfony/debug/Exception/FlattenException.php index b3a98ac..5802c50 100644 --- a/application/vendor/symfony/debug/Exception/FlattenException.php +++ b/application/vendor/symfony/debug/Exception/FlattenException.php @@ -9,49 +9,8 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\HttpKernel\Exception; - -use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; - -/** - * FlattenException wraps a PHP Exception to be able to serialize it. - * - * Basically, this class removes all objects from the trace. - * - * @author Fabien Potencier - * - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. - */ -class FlattenException -{ - private $handler; - - public static function __callStatic($method, $args) - { - if (!method_exists('Symfony\Component\Debug\Exception\FlattenException', $method)) { - throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', get_called_class(), $method)); - } - - return call_user_func_array(array('Symfony\Component\Debug\Exception\FlattenException', $method), $args); - } - - public function __call($method, $args) - { - if (!isset($this->handler)) { - $this->handler = new DebugFlattenException(); - } - - if (!method_exists($this->handler, $method)) { - throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', get_class($this), $method)); - } - - return call_user_func_array(array($this->handler, $method), $args); - } -} - namespace Symfony\Component\Debug\Exception; -use Symfony\Component\HttpKernel\Exception\FlattenException as LegacyFlattenException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; /** @@ -61,7 +20,7 @@ public function __call($method, $args) * * @author Fabien Potencier */ -class FlattenException extends LegacyFlattenException +class FlattenException { private $message; private $code; @@ -263,10 +222,7 @@ private function flattenArgs($args, $level = 0, &$count = 0) if (++$count > 1e4) { return array('array', '*SKIPPED over 10000 entries*'); } - if ($value instanceof \__PHP_Incomplete_Class) { - // is_object() returns false on PHP<=7.1 - $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value)); - } elseif (is_object($value)) { + if (is_object($value)) { $result[$key] = array('object', get_class($value)); } elseif (is_array($value)) { if ($level > 10) { @@ -280,6 +236,9 @@ private function flattenArgs($args, $level = 0, &$count = 0) $result[$key] = array('boolean', $value); } elseif (is_resource($value)) { $result[$key] = array('resource', get_resource_type($value)); + } elseif ($value instanceof \__PHP_Incomplete_Class) { + // Special case of object, is_object will return false + $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value)); } else { $result[$key] = array('string', (string) $value); } diff --git a/application/vendor/symfony/debug/ExceptionHandler.php b/application/vendor/symfony/debug/ExceptionHandler.php index 472073c..8fedc1b 100644 --- a/application/vendor/symfony/debug/ExceptionHandler.php +++ b/application/vendor/symfony/debug/ExceptionHandler.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Debug; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\Debug\Exception\OutOfMemoryException; @@ -38,12 +37,6 @@ class ExceptionHandler public function __construct($debug = true, $charset = null, $fileLinkFormat = null) { - if (false !== strpos($charset, '%')) { - // Swap $charset and $fileLinkFormat for BC reasons - $pivot = $fileLinkFormat; - $fileLinkFormat = $charset; - $charset = $pivot; - } $this->debug = $debug; $this->charset = $charset ?: ini_get('default_charset') ?: 'UTF-8'; $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); @@ -56,7 +49,7 @@ public function __construct($debug = true, $charset = null, $fileLinkFormat = nu * @param string|null $charset The charset used by exception messages * @param string|null $fileLinkFormat The IDE link template * - * @return static + * @return ExceptionHandler The registered exception handler */ public static function register($debug = true, $charset = null, $fileLinkFormat = null) { @@ -78,11 +71,8 @@ public static function register($debug = true, $charset = null, $fileLinkFormat * * @return callable|null The previous exception handler if any */ - public function setHandler($handler) + public function setHandler(callable $handler = null) { - if (null !== $handler && !is_callable($handler)) { - throw new \LogicException('The exception handler must be a valid PHP callable.'); - } $old = $this->handler; $this->handler = $handler; @@ -115,20 +105,36 @@ public function setFileLinkFormat($format) public function handle(\Exception $exception) { if (null === $this->handler || $exception instanceof OutOfMemoryException) { - $this->failSafeHandle($exception); + $this->sendPhpResponse($exception); return; } $caughtLength = $this->caughtLength = 0; - ob_start(array($this, 'catchOutput')); - $this->failSafeHandle($exception); + ob_start(function ($buffer) { + $this->caughtBuffer = $buffer; + + return ''; + }); + + $this->sendPhpResponse($exception); while (null === $this->caughtBuffer && ob_end_flush()) { // Empty loop, everything is in the condition } if (isset($this->caughtBuffer[0])) { - ob_start(array($this, 'cleanOutput')); + ob_start(function ($buffer) { + if ($this->caughtLength) { + // use substr_replace() instead of substr() for mbstring overloading resistance + $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength); + if (isset($cleanBuffer[0])) { + $buffer = $cleanBuffer; + } + } + + return $buffer; + }); + echo $this->caughtBuffer; $caughtLength = ob_get_length(); } @@ -145,37 +151,13 @@ public function handle(\Exception $exception) } } - /** - * Sends a response for the given Exception. - * - * If you have the Symfony HttpFoundation component installed, - * this method will use it to create and send the response. If not, - * it will fallback to plain PHP functions. - */ - private function failSafeHandle(\Exception $exception) - { - if (class_exists('Symfony\Component\HttpFoundation\Response', false) - && __CLASS__ !== get_class($this) - && ($reflector = new \ReflectionMethod($this, 'createResponse')) - && __CLASS__ !== $reflector->class - ) { - $response = $this->createResponse($exception); - $response->sendHeaders(); - $response->sendContent(); - - return; - } - - $this->sendPhpResponse($exception); - } - /** * Sends the error associated with the given Exception as a plain PHP response. * * This method uses plain PHP functions like header() and echo to output * the response. * - * @param \Exception|FlattenException $exception An \Exception instance + * @param \Exception|FlattenException $exception An \Exception or FlattenException instance */ public function sendPhpResponse($exception) { @@ -195,24 +177,26 @@ public function sendPhpResponse($exception) } /** - * Creates the error Response associated with the given Exception. + * Gets the full HTML content associated with the given exception. * - * @param \Exception|FlattenException $exception An \Exception instance + * @param \Exception|FlattenException $exception An \Exception or FlattenException instance * - * @return Response A Response instance + * @return string The HTML content as a string */ - public function createResponse($exception) + public function getHtml($exception) { if (!$exception instanceof FlattenException) { $exception = FlattenException::create($exception); } - return Response::create($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders())->setCharset($this->charset); + return $this->decorate($this->getContent($exception), $this->getStylesheet($exception)); } /** * Gets the HTML content associated with the given exception. * + * @param FlattenException $exception A FlattenException instance + * * @return string The content as a string */ public function getContent(FlattenException $exception) @@ -279,6 +263,8 @@ public function getContent(FlattenException $exception) /** * Gets the stylesheet associated with the given exception. * + * @param FlattenException $exception A FlattenException instance + * * @return string The stylesheet as a string */ public function getStylesheet(FlattenException $exception) @@ -313,7 +299,6 @@ public function getStylesheet(FlattenException $exception) border-bottom:1px solid #ccc; border-right:1px solid #ccc; border-left:1px solid #ccc; - word-wrap: break-word; } .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px; -webkit-border-top-left-radius: 16px; @@ -413,55 +398,17 @@ private function formatArgs(array $args) $formattedValue = str_replace("\n", '', var_export($this->escapeHtml((string) $item[1]), true)); } - $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escapeHtml($key), $formattedValue); + $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue); } return implode(', ', $result); } - /** - * Returns an UTF-8 and HTML encoded string. - * - * @deprecated since version 2.7, to be removed in 3.0. - */ - protected static function utf8Htmlize($str) - { - @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.7 and will be removed in 3.0.', E_USER_DEPRECATED); - - return htmlspecialchars($str, ENT_QUOTES | (\PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8'); - } - /** * HTML-encodes a string. */ private function escapeHtml($str) { - return htmlspecialchars($str, ENT_QUOTES | (\PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), $this->charset); - } - - /** - * @internal - */ - public function catchOutput($buffer) - { - $this->caughtBuffer = $buffer; - - return ''; - } - - /** - * @internal - */ - public function cleanOutput($buffer) - { - if ($this->caughtLength) { - // use substr_replace() instead of substr() for mbstring overloading resistance - $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength); - if (isset($cleanBuffer[0])) { - $buffer = $cleanBuffer; - } - } - - return $buffer; + return htmlspecialchars($str, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset); } } diff --git a/application/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/application/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php index 612bfca..c48d0d3 100644 --- a/application/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php +++ b/application/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php @@ -16,7 +16,6 @@ use Symfony\Component\Debug\DebugClassLoader; use Composer\Autoload\ClassLoader as ComposerClassLoader; use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; -use Symfony\Component\ClassLoader\UniversalClassLoader as SymfonyUniversalClassLoader; /** * ErrorHandler for classes that do not exist. @@ -101,17 +100,12 @@ private function getClassCandidates($class) if ($function[0] instanceof DebugClassLoader) { $function = $function[0]->getClassLoader(); - // @deprecated since version 2.5. Returning an object from DebugClassLoader::getClassLoader() is deprecated. - if (is_object($function)) { - $function = array($function); - } - if (!is_array($function)) { continue; } } - if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader || $function[0] instanceof SymfonyUniversalClassLoader) { + if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) { foreach ($function[0]->getPrefixes() as $prefix => $paths) { foreach ($paths as $path) { $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix)); @@ -179,7 +173,7 @@ private function convertFileToClass($path, $file, $prefix) ); if ($prefix) { - $candidates = array_filter($candidates, function ($candidate) use ($prefix) { return 0 === strpos($candidate, $prefix); }); + $candidates = array_filter($candidates, function ($candidate) use ($prefix) {return 0 === strpos($candidate, $prefix);}); } // We cannot use the autoloader here as most of them use require; but if the class @@ -207,6 +201,6 @@ private function convertFileToClass($path, $file, $prefix) */ private function classExists($class) { - return class_exists($class, false) || interface_exists($class, false) || (function_exists('trait_exists') && trait_exists($class, false)); + return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); } } diff --git a/application/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php b/application/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php index 6fa62b6..f734d6b 100644 --- a/application/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php +++ b/application/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php @@ -36,13 +36,8 @@ public function handleError(array $error, FatalErrorException $exception) $message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className); - if (!class_exists($className) || null === $methods = get_class_methods($className)) { - // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class) - return new UndefinedMethodException($message, $exception); - } - $candidates = array(); - foreach ($methods as $definedMethodName) { + foreach (get_class_methods($className) as $definedMethodName) { $lev = levenshtein($methodName, $definedMethodName); if ($lev <= strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) { $candidates[] = $definedMethodName; @@ -57,7 +52,6 @@ public function handleError(array $error, FatalErrorException $exception) } else { $candidates = '"'.$last; } - $message .= "\nDid you mean to call ".$candidates; } diff --git a/application/vendor/symfony/debug/LICENSE b/application/vendor/symfony/debug/LICENSE index 21d7fb9..12a7453 100644 --- a/application/vendor/symfony/debug/LICENSE +++ b/application/vendor/symfony/debug/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2016 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/application/vendor/symfony/debug/Resources/ext/tests/001.phpt b/application/vendor/symfony/debug/Resources/ext/tests/001.phpt index 4a87cd3..4d41417 100644 --- a/application/vendor/symfony/debug/Resources/ext/tests/001.phpt +++ b/application/vendor/symfony/debug/Resources/ext/tests/001.phpt @@ -1,16 +1,14 @@ --TEST-- Test symfony_zval_info API --SKIPIF-- - + --FILE-- $int, - 'float' => $float, - 'str' => $str, - 'object' => $object, - 'array' => $array, - 'resource' => $resource, - 'null' => $null, - 'bool' => $bool, - 'refcount' => &$refcount2, -); +$var = array('int' => $int, + 'float' => $float, + 'str' => $str, + 'object' => $object, + 'array' => $array, + 'resource' => $resource, + 'null' => $null, + 'bool' => $bool, + 'refcount' => &$refcount2); var_dump(symfony_zval_info('int', $var)); var_dump(symfony_zval_info('float', $var)); diff --git a/application/vendor/symfony/debug/Resources/ext/tests/002.phpt b/application/vendor/symfony/debug/Resources/ext/tests/002.phpt index afc7bb4..ebe2f32 100644 --- a/application/vendor/symfony/debug/Resources/ext/tests/002.phpt +++ b/application/vendor/symfony/debug/Resources/ext/tests/002.phpt @@ -1,9 +1,7 @@ --TEST-- Test symfony_debug_backtrace in case of fatal error --SKIPIF-- - + --FILE-- + --FILE-- + --FILE-- errorReporting = error_reporting(E_ALL | E_STRICT); + $this->errorReporting = error_reporting(E_ALL); $this->loader = new ClassLoader(); spl_autoload_register(array($this->loader, 'loadClass'), true, true); DebugClassLoader::enable(); @@ -59,26 +58,9 @@ public function testIdempotence() $this->fail('DebugClassLoader did not register'); } - /** - * @expectedException \Exception - * @expectedExceptionMessage boo - */ - public function testThrowingClass() - { - try { - class_exists(__NAMESPACE__.'\Fixtures\Throwing'); - $this->fail('Exception expected'); - } catch (\Exception $e) { - $this->assertSame('boo', $e->getMessage()); - } - - // the second call also should throw - class_exists(__NAMESPACE__.'\Fixtures\Throwing'); - } - public function testUnsilencing() { - if (\PHP_VERSION_ID >= 70000) { + if (PHP_VERSION_ID >= 70000) { $this->markTestSkipped('PHP7 throws exceptions, unsilencing is not required anymore.'); } if (defined('HHVM_VERSION')) { @@ -125,27 +107,22 @@ class ChildTestingStacking extends TestingStacking { function foo($bar) {} } $this->fail('ContextErrorException expected'); } catch (\ErrorException $exception) { // if an exception is thrown, the test passed - restore_error_handler(); - restore_exception_handler(); $this->assertStringStartsWith(__FILE__, $exception->getFile()); - if (\PHP_VERSION_ID < 70000) { + if (PHP_VERSION_ID < 70000) { $this->assertRegExp('/^Runtime Notice: Declaration/', $exception->getMessage()); $this->assertEquals(E_STRICT, $exception->getSeverity()); } else { $this->assertRegExp('/^Warning: Declaration/', $exception->getMessage()); $this->assertEquals(E_WARNING, $exception->getSeverity()); } - } catch (\Exception $exception) { + } finally { restore_error_handler(); restore_exception_handler(); - - throw $exception; } } /** * @expectedException \RuntimeException - * @expectedExceptionMessage Case mismatch between loaded and declared class names */ public function testNameCaseMismatch() { @@ -167,7 +144,6 @@ class_exists(__NAMESPACE__.'\Fixtures\CaseMismatch', true); /** * @expectedException \RuntimeException - * @expectedExceptionMessage Case mismatch between loaded and declared class names */ public function testPsr4CaseMismatch() { @@ -208,7 +184,7 @@ class_exists('Test\\'.__NAMESPACE__.'\\'.$class, true); $xError = array( 'type' => E_USER_DEPRECATED, - 'message' => 'The Test\Symfony\Component\Debug\Tests\\'.$class.' class '.$type.' Symfony\Component\Debug\Tests\Fixtures\\'.$super.' that is deprecated but this is a test deprecation notice', + 'message' => 'The Test\Symfony\Component\Debug\Tests\\'.$class.' class '.$type.' Symfony\Component\Debug\Tests\Fixtures\\'.$super.' that is deprecated but this is a test deprecation notice.', ); $this->assertSame($xError, $lastError); @@ -222,6 +198,28 @@ public function provideDeprecatedSuper() ); } + public function testInterfaceExtendsDeprecatedInterface() + { + set_error_handler(function () { return false; }); + $e = error_reporting(0); + trigger_error('', E_USER_NOTICE); + + class_exists('Test\\'.__NAMESPACE__.'\\NonDeprecatedInterfaceClass', true); + + error_reporting($e); + restore_error_handler(); + + $lastError = error_get_last(); + unset($lastError['file'], $lastError['line']); + + $xError = array( + 'type' => E_USER_NOTICE, + 'message' => '', + ); + + $this->assertSame($xError, $lastError); + } + public function testDeprecatedSuperInSameNamespace() { set_error_handler(function () { return false; }); @@ -246,7 +244,7 @@ class_exists('Symfony\Bridge\Debug\Tests\Fixtures\ExtendsDeprecatedParent', true public function testReservedForPhp7() { - if (\PHP_VERSION_ID >= 70000) { + if (PHP_VERSION_ID >= 70000) { $this->markTestSkipped('PHP7 already prevents using reserved names.'); } @@ -308,6 +306,8 @@ public function findFile($class) eval('namespace Test\\'.__NAMESPACE__.'; class DeprecatedParentClass extends \\'.__NAMESPACE__.'\Fixtures\DeprecatedClass {}'); } elseif ('Test\\'.__NAMESPACE__.'\DeprecatedInterfaceClass' === $class) { eval('namespace Test\\'.__NAMESPACE__.'; class DeprecatedInterfaceClass implements \\'.__NAMESPACE__.'\Fixtures\DeprecatedInterface {}'); + } elseif ('Test\\'.__NAMESPACE__.'\NonDeprecatedInterfaceClass' === $class) { + eval('namespace Test\\'.__NAMESPACE__.'; class NonDeprecatedInterfaceClass implements \\'.__NAMESPACE__.'\Fixtures\NonDeprecatedInterface {}'); } elseif ('Test\\'.__NAMESPACE__.'\Float' === $class) { eval('namespace Test\\'.__NAMESPACE__.'; class Float {}'); } diff --git a/application/vendor/symfony/debug/Tests/ErrorHandlerTest.php b/application/vendor/symfony/debug/Tests/ErrorHandlerTest.php index d8f4a74..163ef53 100644 --- a/application/vendor/symfony/debug/Tests/ErrorHandlerTest.php +++ b/application/vendor/symfony/debug/Tests/ErrorHandlerTest.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Debug\Tests; -use PHPUnit\Framework\TestCase; use Psr\Log\LogLevel; use Symfony\Component\Debug\ErrorHandler; +use Symfony\Component\Debug\BufferingLogger; use Symfony\Component\Debug\Exception\ContextErrorException; /** @@ -22,7 +22,7 @@ * @author Robert Schönthal * @author Nicolas Grekas */ -class ErrorHandlerTest extends TestCase +class ErrorHandlerTest extends \PHPUnit_Framework_TestCase { public function testRegister() { @@ -34,7 +34,7 @@ public function testRegister() $newHandler = new ErrorHandler(); - $this->assertSame($handler, ErrorHandler::register($newHandler, false)); + $this->assertSame($newHandler, ErrorHandler::register($newHandler, false)); $h = set_error_handler('var_dump'); restore_error_handler(); $this->assertSame(array($handler, 'handleError'), $h); @@ -64,30 +64,6 @@ public function testRegister() } } - public function testErrorGetLast() - { - $handler = ErrorHandler::register(); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); - $handler->setDefaultLogger($logger); - $handler->screamAt(E_ALL); - - try { - @trigger_error('Hello', E_USER_WARNING); - $expected = array( - 'type' => E_USER_WARNING, - 'message' => 'Hello', - 'file' => __FILE__, - 'line' => __LINE__ - 5, - ); - $this->assertSame($expected, error_get_last()); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - public function testNotice() { ErrorHandler::register(); @@ -97,15 +73,10 @@ public function testNotice() $this->fail('ContextErrorException expected'); } catch (ContextErrorException $exception) { // if an exception is thrown, the test passed - restore_error_handler(); - restore_exception_handler(); - $this->assertEquals(E_NOTICE, $exception->getSeverity()); $this->assertEquals(__FILE__, $exception->getFile()); $this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage()); - if (\PHP_VERSION_ID < 70200) { - $this->assertArrayHasKey('foobar', $exception->getContext()); - } + $this->assertArrayHasKey('foobar', $exception->getContext()); $trace = $exception->getTrace(); $this->assertEquals(__FILE__, $trace[0]['file']); @@ -122,11 +93,9 @@ public function testNotice() $this->assertEquals(__CLASS__, $trace[2]['class']); $this->assertEquals(__FUNCTION__, $trace[2]['function']); $this->assertEquals('->', $trace[2]['type']); - } catch (\Exception $e) { + } finally { restore_error_handler(); restore_exception_handler(); - - throw $e; } } @@ -144,14 +113,9 @@ public function testConstruct() $handler = ErrorHandler::register(); $handler->throwAt(3, true); $this->assertEquals(3 | E_RECOVERABLE_ERROR | E_USER_ERROR, $handler->throwAt(0)); - + } finally { restore_error_handler(); restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; } } @@ -160,7 +124,7 @@ public function testDefaultLogger() try { $handler = ErrorHandler::register(); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $handler->setDefaultLogger($logger, E_NOTICE); $handler->setDefaultLogger($logger, array(E_USER_NOTICE => LogLevel::CRITICAL)); @@ -183,14 +147,9 @@ public function testDefaultLogger() E_CORE_ERROR => array(null, LogLevel::CRITICAL), ); $this->assertSame($loggers, $handler->setLoggers(array())); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { + } finally { restore_error_handler(); restore_exception_handler(); - - throw $e; } } @@ -239,16 +198,15 @@ public function testHandleError() restore_error_handler(); restore_exception_handler(); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); - $that = $this; - $warnArgCheck = function ($logLevel, $message, $context) use ($that) { - $that->assertEquals('info', $logLevel); - $that->assertEquals('foo', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_USER_DEPRECATED); - $that->assertArrayHasKey('stack', $context); - $that->assertInternalType('array', $context['stack']); + $warnArgCheck = function ($logLevel, $message, $context) { + $this->assertEquals('info', $logLevel); + $this->assertEquals('foo', $message); + $this->assertArrayHasKey('type', $context); + $this->assertEquals($context['type'], E_USER_DEPRECATED); + $this->assertArrayHasKey('stack', $context); + $this->assertInternalType('array', $context['stack']); }; $logger @@ -264,13 +222,12 @@ public function testHandleError() restore_error_handler(); restore_exception_handler(); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Undefined variable: undefVar', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_NOTICE); + $logArgCheck = function ($level, $message, $context) { + $this->assertEquals('Undefined variable: undefVar', $message); + $this->assertArrayHasKey('type', $context); + $this->assertEquals($context['type'], E_NOTICE); }; $logger @@ -295,17 +252,38 @@ public function testHandleError() } } + public function testHandleUserError() + { + try { + $handler = ErrorHandler::register(); + $handler->throwAt(0, true); + + $e = null; + $x = new \Exception('Foo'); + + try { + $f = new Fixtures\ToStringThrower($x); + $f .= ''; // Trigger $f->__toString() + } catch (\Exception $e) { + } + + $this->assertSame($x, $e); + } finally { + restore_error_handler(); + restore_exception_handler(); + } + } + public function testHandleDeprecation() { - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals(LogLevel::INFO, $level); - $that->assertArrayHasKey('level', $context); - $that->assertEquals(E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED, $context['level']); - $that->assertArrayHasKey('stack', $context); + $logArgCheck = function ($level, $message, $context) { + $this->assertEquals(LogLevel::INFO, $level); + $this->assertArrayHasKey('level', $context); + $this->assertEquals(E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED, $context['level']); + $this->assertArrayHasKey('stack', $context); }; - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $logger ->expects($this->once()) ->method('log') @@ -317,9 +295,6 @@ public function testHandleDeprecation() @$handler->handleError(E_USER_DEPRECATED, 'Foo deprecation', __FILE__, __LINE__, array()); } - /** - * @group no-hhvm - */ public function testHandleException() { try { @@ -327,13 +302,12 @@ public function testHandleException() $exception = new \Exception('foo'); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Uncaught Exception: foo', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_ERROR); + $logArgCheck = function ($level, $message, $context) { + $this->assertEquals('Uncaught Exception: foo', $message); + $this->assertArrayHasKey('type', $context); + $this->assertEquals($context['type'], E_ERROR); }; $logger @@ -351,20 +325,14 @@ public function testHandleException() $this->assertSame($exception, $e); } - $that = $this; - $handler->setExceptionHandler(function ($e) use ($exception, $that) { - $that->assertSame($exception, $e); + $handler->setExceptionHandler(function ($e) use ($exception) { + $this->assertSame($exception, $e); }); $handler->handleException($exception); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { + } finally { restore_error_handler(); restore_exception_handler(); - - throw $e; } } @@ -374,7 +342,7 @@ public function testErrorStacking() $handler = ErrorHandler::register(); $handler->screamAt(E_USER_WARNING); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $logger ->expects($this->exactly(2)) @@ -391,20 +359,55 @@ public function testErrorStacking() @trigger_error('Silenced warning', E_USER_WARNING); $logger->log(LogLevel::WARNING, 'Dummy log'); ErrorHandler::unstackErrors(); - + } finally { restore_error_handler(); restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; } } - /** - * @group no-hhvm - */ + public function testBootstrappingLogger() + { + $bootLogger = new BufferingLogger(); + $handler = new ErrorHandler($bootLogger); + + $loggers = array( + E_DEPRECATED => array($bootLogger, LogLevel::INFO), + E_USER_DEPRECATED => array($bootLogger, LogLevel::INFO), + E_NOTICE => array($bootLogger, LogLevel::WARNING), + E_USER_NOTICE => array($bootLogger, LogLevel::WARNING), + E_STRICT => array($bootLogger, LogLevel::WARNING), + E_WARNING => array($bootLogger, LogLevel::WARNING), + E_USER_WARNING => array($bootLogger, LogLevel::WARNING), + E_COMPILE_WARNING => array($bootLogger, LogLevel::WARNING), + E_CORE_WARNING => array($bootLogger, LogLevel::WARNING), + E_USER_ERROR => array($bootLogger, LogLevel::CRITICAL), + E_RECOVERABLE_ERROR => array($bootLogger, LogLevel::CRITICAL), + E_COMPILE_ERROR => array($bootLogger, LogLevel::CRITICAL), + E_PARSE => array($bootLogger, LogLevel::CRITICAL), + E_ERROR => array($bootLogger, LogLevel::CRITICAL), + E_CORE_ERROR => array($bootLogger, LogLevel::CRITICAL), + ); + + $this->assertSame($loggers, $handler->setLoggers(array())); + + $handler->handleError(E_DEPRECATED, 'Foo message', __FILE__, 123, array()); + $expectedLog = array(LogLevel::INFO, 'Foo message', array('type' => E_DEPRECATED, 'file' => __FILE__, 'line' => 123, 'level' => error_reporting())); + + $logs = $bootLogger->cleanLogs(); + unset($logs[0][2]['stack']); + + $this->assertSame(array($expectedLog), $logs); + + $bootLogger->log($expectedLog[0], $expectedLog[1], $expectedLog[2]); + + $mockLogger = $this->getMock('Psr\Log\LoggerInterface'); + $mockLogger->expects($this->once()) + ->method('log') + ->with(LogLevel::WARNING, 'Foo message', $expectedLog[2]); + + $handler->setLoggers(array(E_DEPRECATED => array($mockLogger, LogLevel::WARNING))); + } + public function testHandleFatalError() { try { @@ -417,13 +420,12 @@ public function testHandleFatalError() 'line' => 123, ); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Fatal Parse Error: foo', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_PARSE); + $logArgCheck = function ($level, $message, $context) { + $this->assertEquals('Fatal Parse Error: foo', $message); + $this->assertArrayHasKey('type', $context); + $this->assertEquals($context['type'], E_PARSE); }; $logger @@ -464,15 +466,12 @@ public function testHandleErrorException() $this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage()); } - /** - * @group no-hhvm - */ public function testHandleFatalErrorOnHHVM() { try { $handler = ErrorHandler::register(); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $logger = $this->getMock('Psr\Log\LoggerInterface'); $logger ->expects($this->once()) ->method('log') @@ -502,70 +501,9 @@ public function testHandleFatalErrorOnHHVM() call_user_func_array(array($handler, 'handleError'), $error); $handler->handleFatalError($error); - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; - } - } - - /** - * @group legacy - */ - public function testLegacyInterface() - { - try { - $handler = ErrorHandler::register(0); - $this->assertFalse($handler->handle(0, 'foo', 'foo.php', 12, array())); - + } finally { restore_error_handler(); restore_exception_handler(); - - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); - - $that = $this; - $logArgCheck = function ($level, $message, $context) use ($that) { - $that->assertEquals('Undefined variable: undefVar', $message); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], E_NOTICE); - }; - - $logger - ->expects($this->once()) - ->method('log') - ->will($this->returnCallback($logArgCheck)) - ; - - $handler = ErrorHandler::register(E_NOTICE); - @$handler->setLogger($logger, 'scream'); - unset($undefVar); - @$undefVar++; - - restore_error_handler(); - restore_exception_handler(); - } catch (\Exception $e) { - restore_error_handler(); - restore_exception_handler(); - - throw $e; } } - - /** - * @expectedException \Exception - * @group no-hhvm - */ - public function testCustomExceptionHandler() - { - $handler = new ErrorHandler(); - $handler->setExceptionHandler(function ($e) use ($handler) { - $handler->handleException($e); - }); - - $handler->handleException(new \Exception()); - } } diff --git a/application/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php b/application/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php index 269abf0..6c570e2 100644 --- a/application/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php +++ b/application/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Debug\Tests\Exception; -use PHPUnit\Framework\TestCase; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; @@ -28,7 +27,7 @@ use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; -class FlattenExceptionTest extends TestCase +class FlattenExceptionTest extends \PHPUnit_Framework_TestCase { public function testStatusCode() { @@ -105,7 +104,7 @@ public function testHeadersForHttpException() /** * @dataProvider flattenDataProvider */ - public function testFlattenHttpException(\Exception $exception) + public function testFlattenHttpException(\Exception $exception, $statusCode) { $flattened = FlattenException::create($exception); $flattened2 = FlattenException::create($exception); @@ -120,7 +119,7 @@ public function testFlattenHttpException(\Exception $exception) /** * @dataProvider flattenDataProvider */ - public function testPrevious(\Exception $exception) + public function testPrevious(\Exception $exception, $statusCode) { $flattened = FlattenException::create($exception); $flattened2 = FlattenException::create($exception); @@ -167,7 +166,7 @@ public function testFile(\Exception $exception) /** * @dataProvider flattenDataProvider */ - public function testToArray(\Exception $exception) + public function testToArray(\Exception $exception, $statusCode) { $flattened = FlattenException::create($exception); $flattened->setTrace(array(), 'foo.php', 123); @@ -187,13 +186,12 @@ public function testToArray(\Exception $exception) public function flattenDataProvider() { return array( - array(new \Exception('test', 123)), + array(new \Exception('test', 123), 500), ); } public function testRecursionInArguments() { - $a = null; $a = array('foo', array(2, &$a)); $exception = $this->createException($a); diff --git a/application/vendor/symfony/debug/Tests/ExceptionHandlerTest.php b/application/vendor/symfony/debug/Tests/ExceptionHandlerTest.php index 77cc0b5..1703da6 100644 --- a/application/vendor/symfony/debug/Tests/ExceptionHandlerTest.php +++ b/application/vendor/symfony/debug/Tests/ExceptionHandlerTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Debug\Tests; -use PHPUnit\Framework\TestCase; use Symfony\Component\Debug\ExceptionHandler; use Symfony\Component\Debug\Exception\OutOfMemoryException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -19,7 +18,7 @@ require_once __DIR__.'/HeaderMock.php'; -class ExceptionHandlerTest extends TestCase +class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { @@ -101,16 +100,15 @@ public function testHandle() { $exception = new \Exception('foo'); - $handler = $this->getMockBuilder('Symfony\Component\Debug\ExceptionHandler')->setMethods(array('sendPhpResponse'))->getMock(); + $handler = $this->getMock('Symfony\Component\Debug\ExceptionHandler', array('sendPhpResponse')); $handler ->expects($this->exactly(2)) ->method('sendPhpResponse'); $handler->handle($exception); - $that = $this; - $handler->setHandler(function ($e) use ($exception, $that) { - $that->assertSame($exception, $e); + $handler->setHandler(function ($e) use ($exception) { + $this->assertSame($exception, $e); }); $handler->handle($exception); @@ -120,14 +118,13 @@ public function testHandleOutOfMemoryException() { $exception = new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__); - $handler = $this->getMockBuilder('Symfony\Component\Debug\ExceptionHandler')->setMethods(array('sendPhpResponse'))->getMock(); + $handler = $this->getMock('Symfony\Component\Debug\ExceptionHandler', array('sendPhpResponse')); $handler ->expects($this->once()) ->method('sendPhpResponse'); - $that = $this; - $handler->setHandler(function ($e) use ($that) { - $that->fail('OutOfMemoryException should bypass the handler'); + $handler->setHandler(function ($e) { + $this->fail('OutOfMemoryException should bypass the handler'); }); $handler->handle($exception); diff --git a/application/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/application/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php index 0611ed9..360e6ed 100644 --- a/application/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php +++ b/application/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php @@ -11,15 +11,13 @@ namespace Symfony\Component\Debug\Tests\FatalErrorHandler; -use PHPUnit\Framework\TestCase; -use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; -use Symfony\Component\ClassLoader\UniversalClassLoader as SymfonyUniversalClassLoader; use Symfony\Component\Debug\Exception\FatalErrorException; +use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler; use Symfony\Component\Debug\DebugClassLoader; use Composer\Autoload\ClassLoader as ComposerClassLoader; -class ClassNotFoundFatalErrorHandlerTest extends TestCase +class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase { public static function setUpBeforeClass() { @@ -69,27 +67,6 @@ public function testHandleClassNotFound($error, $translatedMessage, $autoloader $this->assertSame($error['line'], $exception->getLine()); } - /** - * @group legacy - */ - public function testLegacyHandleClassNotFound() - { - $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); - $symfonyUniversalClassLoader = new SymfonyUniversalClassLoader(); - $symfonyUniversalClassLoader->registerPrefixes($prefixes); - - $this->testHandleClassNotFound( - array( - 'type' => 1, - 'line' => 12, - 'file' => 'foo.php', - 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found', - ), - "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?", - array($symfonyUniversalClassLoader, 'loadClass') - ); - } - public function provideClassNotFoundData() { $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception')); diff --git a/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php b/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php index 1dc2120..795b747 100644 --- a/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php +++ b/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Debug\Tests\FatalErrorHandler; -use PHPUnit\Framework\TestCase; use Symfony\Component\Debug\Exception\FatalErrorException; use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler; -class UndefinedFunctionFatalErrorHandlerTest extends TestCase +class UndefinedFunctionFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider provideUndefinedFunctionData diff --git a/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php b/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php index 739e5b2..de7b21c 100644 --- a/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php +++ b/application/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php @@ -11,11 +11,10 @@ namespace Symfony\Component\Debug\Tests\FatalErrorHandler; -use PHPUnit\Framework\TestCase; use Symfony\Component\Debug\Exception\FatalErrorException; use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler; -class UndefinedMethodFatalErrorHandlerTest extends TestCase +class UndefinedMethodFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider provideUndefinedMethodData @@ -62,15 +61,6 @@ public function provideUndefinedMethodData() ), "Attempted to call an undefined method named \"offsetFet\" of class \"SplObjectStorage\".\nDid you mean to call e.g. \"offsetGet\", \"offsetSet\" or \"offsetUnset\"?", ), - array( - array( - 'type' => 1, - 'message' => 'Call to undefined method class@anonymous::test()', - 'file' => '/home/possum/work/symfony/test.php', - 'line' => 11, - ), - 'Attempted to call an undefined method named "test" of class "class@anonymous".', - ), ); } } diff --git a/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedClass.php b/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedClass.php index 51fde5a..b4c78cd 100644 --- a/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedClass.php +++ b/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedClass.php @@ -4,7 +4,7 @@ /** * @deprecated but this is a test - * deprecation notice + * deprecation notice. * @foobar */ class DeprecatedClass diff --git a/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedInterface.php b/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedInterface.php index 6bab62f..505ecca 100644 --- a/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedInterface.php +++ b/application/vendor/symfony/debug/Tests/Fixtures/DeprecatedInterface.php @@ -4,7 +4,7 @@ /** * @deprecated but this is a test - * deprecation notice + * deprecation notice. * @foobar */ interface DeprecatedInterface diff --git a/application/vendor/symfony/debug/Tests/Fixtures/NonDeprecatedInterface.php b/application/vendor/symfony/debug/Tests/Fixtures/NonDeprecatedInterface.php new file mode 100644 index 0000000..a4179a5 --- /dev/null +++ b/application/vendor/symfony/debug/Tests/Fixtures/NonDeprecatedInterface.php @@ -0,0 +1,7 @@ +exception = $e; + } + + public function __toString() + { + try { + throw $this->exception; + } catch (\Exception $e) { + // Using user_error() here is on purpose so we do not forget + // that this alias also should work alongside with trigger_error(). + return user_error($e, E_USER_ERROR); + } + } +} diff --git a/application/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt b/application/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt deleted file mode 100644 index 1de9b29..0000000 --- a/application/vendor/symfony/debug/Tests/phpt/decorate_exception_hander.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -Test catching fatal errors when handlers are nested ---FILE-- - ---EXPECTF-- -Fatal error: Class 'Symfony\Component\Debug\missing' not found in %s on line %d -object(Symfony\Component\Debug\Exception\ClassNotFoundException)#%d (8) { - ["message":protected]=> - string(131) "Attempted to load class "missing" from namespace "Symfony\Component\Debug". -Did you forget a "use" statement for another namespace?" - ["string":"Exception":private]=> - string(0) "" - ["code":protected]=> - int(0) - ["file":protected]=> - string(%d) "%s" - ["line":protected]=> - int(%d) - ["trace":"Exception":private]=> - array(%d) {%A} - ["previous":"Exception":private]=> - NULL - ["severity":protected]=> - int(1) -} diff --git a/application/vendor/symfony/debug/Tests/phpt/exception_rethrown.phpt b/application/vendor/symfony/debug/Tests/phpt/exception_rethrown.phpt deleted file mode 100644 index 9df0a65..0000000 --- a/application/vendor/symfony/debug/Tests/phpt/exception_rethrown.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -Test rethrowing in custom exception handler ---FILE-- -setDefaultLogger(new TestLogger()); -ini_set('display_errors', 1); - -throw new \Exception('foo'); -?> ---EXPECTF-- -Uncaught Exception: foo -123 -Fatal error: Uncaught %s:25 -Stack trace: -%a diff --git a/application/vendor/symfony/debug/Tests/phpt/fatal_with_nested_handlers.phpt b/application/vendor/symfony/debug/Tests/phpt/fatal_with_nested_handlers.phpt deleted file mode 100644 index 897be3e..0000000 --- a/application/vendor/symfony/debug/Tests/phpt/fatal_with_nested_handlers.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -Test catching fatal errors when handlers are nested ---FILE-- -setExceptionHandler('print_r'); - -if (true) { - class Broken implements \Serializable - { - } -} - -?> ---EXPECTF-- -array(1) { - [0]=> - string(37) "Error and exception handlers do match" -} -object(Symfony\Component\Debug\Exception\FatalErrorException)#%d (8) { - ["message":protected]=> - string(199) "Error: Class Symfony\Component\Debug\Broken contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Serializable::serialize, Serializable::unserialize)" -%a -} diff --git a/application/vendor/symfony/debug/composer.json b/application/vendor/symfony/debug/composer.json index 2ae0685..0eef83e 100644 --- a/application/vendor/symfony/debug/composer.json +++ b/application/vendor/symfony/debug/composer.json @@ -16,15 +16,15 @@ } ], "require": { - "php": ">=5.3.9", + "php": ">=5.5.9", "psr/log": "~1.0" }, "conflict": { "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/class-loader": "~2.2", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2" + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" }, "autoload": { "psr-4": { "Symfony\\Component\\Debug\\": "" }, @@ -35,7 +35,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } } } diff --git a/application/vendor/symfony/debug/phpunit.xml.dist b/application/vendor/symfony/debug/phpunit.xml.dist index 12e5861..e99c4dd 100644 --- a/application/vendor/symfony/debug/phpunit.xml.dist +++ b/application/vendor/symfony/debug/phpunit.xml.dist @@ -5,8 +5,6 @@ backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" - failOnRisky="true" - failOnWarning="true" > diff --git a/application/vendor/symfony/dom-crawler/AbstractUriElement.php b/application/vendor/symfony/dom-crawler/AbstractUriElement.php new file mode 100644 index 0000000..97604bc --- /dev/null +++ b/application/vendor/symfony/dom-crawler/AbstractUriElement.php @@ -0,0 +1,212 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DomCrawler; + +/** + * Any HTML element that can link to an URI. + * + * @author Fabien Potencier + */ +abstract class AbstractUriElement +{ + /** + * @var \DOMElement + */ + protected $node; + + /** + * @var string The method to use for the element + */ + protected $method; + + /** + * @var string The URI of the page where the element is embedded (or the base href) + */ + protected $currentUri; + + /** + * @param \DOMElement $node A \DOMElement instance + * @param string $currentUri The URI of the page where the link is embedded (or the base href) + * @param string $method The method to use for the link (get by default) + * + * @throws \InvalidArgumentException if the node is not a link + */ + public function __construct(\DOMElement $node, $currentUri, $method = 'GET') + { + if (!\in_array(strtolower(substr($currentUri, 0, 4)), ['http', 'file'])) { + throw new \InvalidArgumentException(sprintf('Current URI must be an absolute URL ("%s").', $currentUri)); + } + + $this->setNode($node); + $this->method = $method ? strtoupper($method) : null; + $this->currentUri = $currentUri; + } + + /** + * Gets the node associated with this link. + * + * @return \DOMElement A \DOMElement instance + */ + public function getNode() + { + return $this->node; + } + + /** + * Gets the method associated with this link. + * + * @return string The method + */ + public function getMethod() + { + return $this->method; + } + + /** + * Gets the URI associated with this link. + * + * @return string The URI + */ + public function getUri() + { + $uri = trim($this->getRawUri()); + + // absolute URL? + if (null !== parse_url($uri, \PHP_URL_SCHEME)) { + return $uri; + } + + // empty URI + if (!$uri) { + return $this->currentUri; + } + + // an anchor + if ('#' === $uri[0]) { + return $this->cleanupAnchor($this->currentUri).$uri; + } + + $baseUri = $this->cleanupUri($this->currentUri); + + if ('?' === $uri[0]) { + return $baseUri.$uri; + } + + // absolute URL with relative schema + if (0 === strpos($uri, '//')) { + return preg_replace('#^([^/]*)//.*$#', '$1', $baseUri).$uri; + } + + $baseUri = preg_replace('#^(.*?//[^/]*)(?:\/.*)?$#', '$1', $baseUri); + + // absolute path + if ('/' === $uri[0]) { + return $baseUri.$uri; + } + + // relative path + $path = parse_url(substr($this->currentUri, \strlen($baseUri)), \PHP_URL_PATH); + $path = $this->canonicalizePath(substr($path, 0, strrpos($path, '/')).'/'.$uri); + + return $baseUri.('' === $path || '/' !== $path[0] ? '/' : '').$path; + } + + /** + * Returns raw URI data. + * + * @return string + */ + abstract protected function getRawUri(); + + /** + * Returns the canonicalized URI path (see RFC 3986, section 5.2.4). + * + * @param string $path URI path + * + * @return string + */ + protected function canonicalizePath($path) + { + if ('' === $path || '/' === $path) { + return $path; + } + + if ('.' === substr($path, -1)) { + $path .= '/'; + } + + $output = []; + + foreach (explode('/', $path) as $segment) { + if ('..' === $segment) { + array_pop($output); + } elseif ('.' !== $segment) { + $output[] = $segment; + } + } + + return implode('/', $output); + } + + /** + * Sets current \DOMElement instance. + * + * @param \DOMElement $node A \DOMElement instance + * + * @throws \LogicException If given node is not an anchor + */ + abstract protected function setNode(\DOMElement $node); + + /** + * Removes the query string and the anchor from the given uri. + * + * @param string $uri The uri to clean + * + * @return string + */ + private function cleanupUri($uri) + { + return $this->cleanupQuery($this->cleanupAnchor($uri)); + } + + /** + * Remove the query string from the uri. + * + * @param string $uri + * + * @return string + */ + private function cleanupQuery($uri) + { + if (false !== $pos = strpos($uri, '?')) { + return substr($uri, 0, $pos); + } + + return $uri; + } + + /** + * Remove the anchor from the uri. + * + * @param string $uri + * + * @return string + */ + private function cleanupAnchor($uri) + { + if (false !== $pos = strpos($uri, '#')) { + return substr($uri, 0, $pos); + } + + return $uri; + } +} diff --git a/application/vendor/symfony/dom-crawler/CHANGELOG.md b/application/vendor/symfony/dom-crawler/CHANGELOG.md index 48fd323..e65176f 100644 --- a/application/vendor/symfony/dom-crawler/CHANGELOG.md +++ b/application/vendor/symfony/dom-crawler/CHANGELOG.md @@ -1,6 +1,14 @@ CHANGELOG ========= +3.1.0 +----- + +* All the URI parsing logic have been abstracted in the `AbstractUriElement` class. + The `Link` class is now a child of `AbstractUriElement`. +* Added an `Image` class to crawl images and parse their `src` attribute, + and `selectImage`, `image`, `images` methods in the `Crawler` (the image version of the equivalent `link` methods). + 2.5.0 ----- diff --git a/application/vendor/symfony/dom-crawler/Crawler.php b/application/vendor/symfony/dom-crawler/Crawler.php index 8cfd510..21f7fab 100644 --- a/application/vendor/symfony/dom-crawler/Crawler.php +++ b/application/vendor/symfony/dom-crawler/Crawler.php @@ -11,14 +11,14 @@ namespace Symfony\Component\DomCrawler; -use Symfony\Component\CssSelector\CssSelector; +use Symfony\Component\CssSelector\CssSelectorConverter; /** - * Crawler eases navigation of a list of \DOMElement objects. + * Crawler eases navigation of a list of \DOMNode objects. * * @author Fabien Potencier */ -class Crawler extends \SplObjectStorage +class Crawler implements \Countable, \IteratorAggregate { protected $uri; @@ -30,7 +30,7 @@ class Crawler extends \SplObjectStorage /** * @var array A map of manually registered namespaces */ - private $namespaces = array(); + private $namespaces = []; /** * @var string The base href value @@ -38,9 +38,24 @@ class Crawler extends \SplObjectStorage private $baseHref; /** - * @param mixed $node A Node to use as the base for the crawling - * @param string $uri The current URI - * @param string $baseHref The base href value + * @var \DOMDocument|null + */ + private $document; + + /** + * @var \DOMNode[] + */ + private $nodes = []; + + /** + * Whether the Crawler contains HTML or XML content (used when converting CSS to XPath). + * + * @var bool + */ + private $isHtml = true; + + /** + * @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling */ public function __construct($node = null, $uri = null, $baseHref = null) { @@ -50,12 +65,33 @@ public function __construct($node = null, $uri = null, $baseHref = null) $this->add($node); } + /** + * Returns the current URI. + * + * @return string + */ + public function getUri() + { + return $this->uri; + } + + /** + * Returns base href. + * + * @return string + */ + public function getBaseHref() + { + return $this->baseHref; + } + /** * Removes all the nodes. */ public function clear() { - $this->removeAll($this); + $this->nodes = []; + $this->document = null; } /** @@ -64,7 +100,7 @@ public function clear() * This method uses the appropriate specialized add*() method based * on the type of the argument. * - * @param \DOMNodeList|\DOMNode|array|string|null $node A node + * @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A node * * @throws \InvalidArgumentException when node is not the expected type */ @@ -74,24 +110,24 @@ public function add($node) $this->addNodeList($node); } elseif ($node instanceof \DOMNode) { $this->addNode($node); - } elseif (is_array($node)) { + } elseif (\is_array($node)) { $this->addNodes($node); - } elseif (is_string($node)) { + } elseif (\is_string($node)) { $this->addContent($node); } elseif (null !== $node) { - throw new \InvalidArgumentException(sprintf('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s".', is_object($node) ? get_class($node) : gettype($node))); + throw new \InvalidArgumentException(sprintf('Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "%s".', \is_object($node) ? \get_class($node) : \gettype($node))); } } /** * Adds HTML/XML content. * - * If the charset is not set via the content type, it is assumed - * to be ISO-8859-1, which is the default charset defined by the + * If the charset is not set via the content type, it is assumed to be UTF-8, + * or ISO-8859-1 as a fallback, which is the default charset defined by the * HTTP 1.1 specification. * * @param string $content A string to parse as HTML/XML - * @param null|string $type The content type of the string + * @param string|null $type The content type of the string */ public function addContent($content, $type = null) { @@ -120,7 +156,7 @@ public function addContent($content, $type = null) } if (null === $charset) { - $charset = 'ISO-8859-1'; + $charset = preg_match('//u', $content) ? 'UTF-8' : 'ISO-8859-1'; } if ('x' === $xmlMatches[1]) { @@ -146,7 +182,9 @@ public function addContent($content, $type = null) public function addHtmlContent($content, $charset = 'UTF-8') { $internalErrors = libxml_use_internal_errors(true); - $disableEntities = libxml_disable_entity_loader(true); + if (\LIBXML_VERSION < 20900) { + $disableEntities = libxml_disable_entity_loader(true); + } $dom = new \DOMDocument('1.0', $charset); $dom->validateOnParse = true; @@ -155,52 +193,28 @@ public function addHtmlContent($content, $charset = 'UTF-8') try { // Convert charset to HTML-entities to work around bugs in DOMDocument::loadHTML() - - if (function_exists('mb_convert_encoding')) { - $content = mb_convert_encoding($content, 'HTML-ENTITIES', $charset); - } elseif (function_exists('iconv')) { - $content = preg_replace_callback( - '/[\x80-\xFF]+/', - function ($m) { - $m = unpack('C*', $m[0]); - $i = 1; - $entities = ''; - - while (isset($m[$i])) { - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - }, - iconv($charset, 'UTF-8', $content) - ); - } + $content = mb_convert_encoding($content, 'HTML-ENTITIES', $charset); } catch (\Exception $e) { + } catch (\ValueError $e) { + } finally { + restore_error_handler(); } - restore_error_handler(); - if ('' !== trim($content)) { @$dom->loadHTML($content); } libxml_use_internal_errors($internalErrors); - libxml_disable_entity_loader($disableEntities); + if (\LIBXML_VERSION < 20900) { + libxml_disable_entity_loader($disableEntities); + } $this->addDocument($dom); - $base = $this->filterRelativeXPath('descendant-or-self::base')->extract(array('href')); + $base = $this->filterRelativeXPath('descendant-or-self::base')->extract(['href']); $baseHref = current($base); - if (count($base) && !empty($baseHref)) { + if (\count($base) && !empty($baseHref)) { if ($this->baseHref) { $linkNode = $dom->createElement('a'); $linkNode->setAttribute('href', $baseHref); @@ -228,7 +242,7 @@ function ($m) { * LIBXML_PARSEHUGE is dangerous, see * http://symfony.com/blog/security-release-symfony-2-0-17-released */ - public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NONET) + public function addXmlContent($content, $charset = 'UTF-8', $options = \LIBXML_NONET) { // remove the default namespace if it's the only namespace to make XPath expressions simpler if (!preg_match('/xmlns:/', $content)) { @@ -236,7 +250,9 @@ public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NO } $internalErrors = libxml_use_internal_errors(true); - $disableEntities = libxml_disable_entity_loader(true); + if (\LIBXML_VERSION < 20900) { + $disableEntities = libxml_disable_entity_loader(true); + } $dom = new \DOMDocument('1.0', $charset); $dom->validateOnParse = true; @@ -246,9 +262,13 @@ public function addXmlContent($content, $charset = 'UTF-8', $options = LIBXML_NO } libxml_use_internal_errors($internalErrors); - libxml_disable_entity_loader($disableEntities); + if (\LIBXML_VERSION < 20900) { + libxml_disable_entity_loader($disableEntities); + } $this->addDocument($dom); + + $this->isHtml = false; } /** @@ -297,21 +317,23 @@ public function addNodes(array $nodes) public function addNode(\DOMNode $node) { if ($node instanceof \DOMDocument) { - $this->attach($node->documentElement); - } else { - $this->attach($node); + $node = $node->documentElement; } - } - // Serializing and unserializing a crawler creates DOM objects in a corrupted state. DOM elements are not properly serializable. - public function unserialize($serialized) - { - throw new \BadMethodCallException('A Crawler cannot be serialized.'); - } + if (null !== $this->document && $this->document !== $node->ownerDocument) { + throw new \InvalidArgumentException('Attaching DOM nodes from multiple documents in the same crawler is forbidden.'); + } - public function serialize() - { - throw new \BadMethodCallException('A Crawler cannot be serialized.'); + if (null === $this->document) { + $this->document = $node->ownerDocument; + } + + // Don't add duplicate nodes in the Crawler + if (\in_array($node, $this->nodes, true)) { + return; + } + + $this->nodes[] = $node; } /** @@ -319,14 +341,12 @@ public function serialize() * * @param int $position The position * - * @return self + * @return static */ public function eq($position) { - foreach ($this as $i => $node) { - if ($i == $position) { - return $this->createSubCrawler($node); - } + if (isset($this->nodes[$position])) { + return $this->createSubCrawler($this->nodes[$position]); } return $this->createSubCrawler(null); @@ -350,8 +370,8 @@ public function eq($position) */ public function each(\Closure $closure) { - $data = array(); - foreach ($this as $i => $node) { + $data = []; + foreach ($this->nodes as $i => $node) { $data[] = $closure($this->createSubCrawler($node), $i); } @@ -364,11 +384,11 @@ public function each(\Closure $closure) * @param int $offset * @param int $length * - * @return self + * @return static */ - public function slice($offset = 0, $length = -1) + public function slice($offset = 0, $length = null) { - return $this->createSubCrawler(iterator_to_array(new \LimitIterator($this, $offset, $length))); + return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length)); } /** @@ -378,12 +398,12 @@ public function slice($offset = 0, $length = -1) * * @param \Closure $closure An anonymous function * - * @return self + * @return static */ public function reduce(\Closure $closure) { - $nodes = array(); - foreach ($this as $i => $node) { + $nodes = []; + foreach ($this->nodes as $i => $node) { if (false !== $closure($this->createSubCrawler($node), $i)) { $nodes[] = $node; } @@ -395,7 +415,7 @@ public function reduce(\Closure $closure) /** * Returns the first node of the current selection. * - * @return self + * @return static */ public function first() { @@ -405,23 +425,23 @@ public function first() /** * Returns the last node of the current selection. * - * @return self + * @return static */ public function last() { - return $this->eq(count($this) - 1); + return $this->eq(\count($this->nodes) - 1); } /** * Returns the siblings nodes of the current selection. * - * @return self + * @return static * * @throws \InvalidArgumentException When current node is empty */ public function siblings() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -431,13 +451,13 @@ public function siblings() /** * Returns the next siblings nodes of the current selection. * - * @return self + * @return static * * @throws \InvalidArgumentException When current node is empty */ public function nextAll() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -447,13 +467,13 @@ public function nextAll() /** * Returns the previous sibling nodes of the current selection. * - * @return self + * @return static * * @throws \InvalidArgumentException */ public function previousAll() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -463,21 +483,21 @@ public function previousAll() /** * Returns the parents nodes of the current selection. * - * @return self + * @return static * * @throws \InvalidArgumentException When current node is empty */ public function parents() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } $node = $this->getNode(0); - $nodes = array(); + $nodes = []; while ($node = $node->parentNode) { - if (XML_ELEMENT_NODE === $node->nodeType) { + if (\XML_ELEMENT_NODE === $node->nodeType) { $nodes[] = $node; } } @@ -488,19 +508,19 @@ public function parents() /** * Returns the children nodes of the current selection. * - * @return self + * @return static * * @throws \InvalidArgumentException When current node is empty */ public function children() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } $node = $this->getNode(0)->firstChild; - return $this->createSubCrawler($node ? $this->sibling($node) : array()); + return $this->createSubCrawler($node ? $this->sibling($node) : []); } /** @@ -514,7 +534,7 @@ public function children() */ public function attr($attribute) { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -532,7 +552,7 @@ public function attr($attribute) */ public function nodeName() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -548,7 +568,7 @@ public function nodeName() */ public function text() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -564,7 +584,7 @@ public function text() */ public function html() { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } @@ -576,6 +596,36 @@ public function html() return $html; } + /** + * Evaluates an XPath expression. + * + * Since an XPath expression might evaluate to either a simple type or a \DOMNodeList, + * this method will return either an array of simple types or a new Crawler instance. + * + * @param string $xpath An XPath expression + * + * @return array|Crawler An array of evaluation results or a new Crawler instance + */ + public function evaluate($xpath) + { + if (null === $this->document) { + throw new \LogicException('Cannot evaluate the expression on an uninitialized crawler.'); + } + + $data = []; + $domxpath = $this->createDOMXPath($this->document, $this->findNamespacePrefixes($xpath)); + + foreach ($this->nodes as $node) { + $data[] = $domxpath->evaluate($xpath, $node); + } + + if (isset($data[0]) && $data[0] instanceof \DOMNodeList) { + return $this->createSubCrawler($data); + } + + return $data; + } + /** * Extracts information from the list of nodes. * @@ -583,7 +633,7 @@ public function html() * * Example: * - * $crawler->filter('h1 a')->extract(array('_text', 'href')); + * $crawler->filter('h1 a')->extract(['_text', 'href']); * * @param array $attributes An array of attributes * @@ -592,11 +642,11 @@ public function html() public function extract($attributes) { $attributes = (array) $attributes; - $count = count($attributes); + $count = \count($attributes); - $data = array(); - foreach ($this as $node) { - $elements = array(); + $data = []; + foreach ($this->nodes as $node) { + $elements = []; foreach ($attributes as $attribute) { if ('_text' === $attribute) { $elements[] = $node->nodeValue; @@ -621,7 +671,7 @@ public function extract($attributes) * * @param string $xpath An XPath expression * - * @return self + * @return static */ public function filterXPath($xpath) { @@ -642,18 +692,20 @@ public function filterXPath($xpath) * * @param string $selector A CSS selector * - * @return self + * @return static * * @throws \RuntimeException if the CssSelector Component is not available */ public function filter($selector) { - if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) { - throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector is not installed (you can use filterXPath instead).'); + if (!class_exists(CssSelectorConverter::class)) { + throw new \RuntimeException('To filter with a CSS selector, install the CssSelector component ("composer require symfony/css-selector"). Or use filterXpath instead.'); } + $converter = new CssSelectorConverter($this->isHtml); + // The CssSelector already prefixes the selector with descendant-or-self:: - return $this->filterRelativeXPath(CssSelector::toXPath($selector)); + return $this->filterRelativeXPath($converter->toXPath($selector)); } /** @@ -661,7 +713,7 @@ public function filter($selector) * * @param string $value The link text * - * @return self + * @return static */ public function selectLink($value) { @@ -671,12 +723,26 @@ public function selectLink($value) return $this->filterRelativeXPath($xpath); } + /** + * Selects images by alt value. + * + * @param string $value The image alt + * + * @return static A new instance of Crawler with the filtered list of nodes + */ + public function selectImage($value) + { + $xpath = sprintf('descendant-or-self::img[contains(normalize-space(string(@alt)), %s)]', static::xpathLiteral($value)); + + return $this->filterRelativeXPath($xpath); + } + /** * Selects a button by name or alt value for images. * * @param string $value The button text * - * @return self + * @return static */ public function selectButton($value) { @@ -695,16 +761,20 @@ public function selectButton($value) * * @return Link A Link instance * - * @throws \InvalidArgumentException If the current node list is empty + * @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement */ public function link($method = 'get') { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } $node = $this->getNode(0); + if (!$node instanceof \DOMElement) { + throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', \get_class($node))); + } + return new Link($node, $this->baseHref, $method); } @@ -712,17 +782,64 @@ public function link($method = 'get') * Returns an array of Link objects for the nodes in the list. * * @return Link[] An array of Link instances + * + * @throws \InvalidArgumentException If the current node list contains non-DOMElement instances */ public function links() { - $links = array(); - foreach ($this as $node) { + $links = []; + foreach ($this->nodes as $node) { + if (!$node instanceof \DOMElement) { + throw new \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', \get_class($node))); + } + $links[] = new Link($node, $this->baseHref, 'get'); } return $links; } + /** + * Returns an Image object for the first node in the list. + * + * @return Image An Image instance + * + * @throws \InvalidArgumentException If the current node list is empty + */ + public function image() + { + if (!\count($this)) { + throw new \InvalidArgumentException('The current node list is empty.'); + } + + $node = $this->getNode(0); + + if (!$node instanceof \DOMElement) { + throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', \get_class($node))); + } + + return new Image($node, $this->baseHref); + } + + /** + * Returns an array of Image objects for the nodes in the list. + * + * @return Image[] An array of Image instances + */ + public function images() + { + $images = []; + foreach ($this as $node) { + if (!$node instanceof \DOMElement) { + throw new \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', \get_class($node))); + } + + $images[] = new Image($node, $this->baseHref); + } + + return $images; + } + /** * Returns a Form object for the first node in the list. * @@ -731,15 +848,21 @@ public function links() * * @return Form A Form instance * - * @throws \InvalidArgumentException If the current node list is empty + * @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement */ public function form(array $values = null, $method = null) { - if (!count($this)) { + if (!$this->nodes) { throw new \InvalidArgumentException('The current node list is empty.'); } - $form = new Form($this->getNode(0), $this->uri, $method, $this->baseHref); + $node = $this->getNode(0); + + if (!$node instanceof \DOMElement) { + throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', \get_class($node))); + } + + $form = new Form($node, $this->uri, $method, $this->baseHref); if (null !== $values) { $form->setValues($values); @@ -773,7 +896,7 @@ public function registerNamespace($prefix, $namespace) * Escaped characters are: quotes (") and apostrophe ('). * * Examples: - * + * * echo Crawler::xpathLiteral('foo " bar'); * //prints 'foo " bar' * @@ -782,7 +905,6 @@ public function registerNamespace($prefix, $namespace) * * echo Crawler::xpathLiteral('a\'b"c'); * //prints concat('a', "'", 'b"c') - * * * @param string $s String to be escaped * @@ -799,7 +921,7 @@ public static function xpathLiteral($s) } $string = $s; - $parts = array(); + $parts = []; while (true) { if (false !== $pos = strpos($string, "'")) { $parts[] = sprintf("'%s'", substr($string, 0, $pos)); @@ -821,7 +943,7 @@ public static function xpathLiteral($s) * * @param string $xpath * - * @return self + * @return static */ private function filterRelativeXPath($xpath) { @@ -829,7 +951,7 @@ private function filterRelativeXPath($xpath) $crawler = $this->createSubCrawler(null); - foreach ($this as $node) { + foreach ($this->nodes as $node) { $domxpath = $this->createDOMXPath($node->ownerDocument, $prefixes); $crawler->add($domxpath->query($xpath, $node)); } @@ -849,13 +971,13 @@ private function filterRelativeXPath($xpath) */ private function relativize($xpath) { - $expressions = array(); + $expressions = []; // An expression which will never match to replace expressions which cannot match in the crawler - // We cannot simply drop + // We cannot drop $nonMatchingExpression = 'a[name() = "b"]'; - $xpathLen = strlen($xpath); + $xpathLen = \strlen($xpath); $openedBrackets = 0; $startPosition = strspn($xpath, " \t\n\r\0\x0B"); @@ -893,10 +1015,7 @@ private function relativize($xpath) } $expression = rtrim(substr($xpath, $startPosition, $i - $startPosition)); - // BC for Symfony 2.4 and lower were elements were adding in a fake _root parent - if (0 === strpos($expression, '/_root/')) { - $expression = './'.substr($expression, 7); - } elseif (0 === strpos($expression, 'self::*/')) { + if (0 === strpos($expression, 'self::*/')) { $expression = './'.substr($expression, 8); } @@ -911,12 +1030,7 @@ private function relativize($xpath) $expression = 'self::'.substr($expression, 2); } elseif (0 === strpos($expression, 'child::')) { $expression = 'self::'.substr($expression, 7); - } elseif ('/' === $expression[0] || 0 === strpos($expression, 'self::')) { - // the only direct child in Symfony 2.4 and lower is _root, which is already handled previously - // so let's drop the expression entirely - $expression = $nonMatchingExpression; - } elseif ('.' === $expression[0]) { - // '.' is the fake root element in Symfony 2.4 and lower, which is excluded from results + } elseif ('/' === $expression[0] || '.' === $expression[0] || 0 === strpos($expression, 'self::')) { $expression = $nonMatchingExpression; } elseif (0 === strpos($expression, 'descendant::')) { $expression = 'descendant-or-self::'.substr($expression, 12); @@ -942,15 +1056,27 @@ private function relativize($xpath) /** * @param int $position * - * @return \DOMElement|null + * @return \DOMNode|null */ public function getNode($position) { - foreach ($this as $i => $node) { - if ($i == $position) { - return $node; - } - } + return isset($this->nodes[$position]) ? $this->nodes[$position] : null; + } + + /** + * @return int + */ + public function count() + { + return \count($this->nodes); + } + + /** + * @return \ArrayIterator|\DOMNode[] + */ + public function getIterator() + { + return new \ArrayIterator($this->nodes); } /** @@ -961,7 +1087,7 @@ public function getNode($position) */ protected function sibling($node, $siblingDir = 'nextSibling') { - $nodes = array(); + $nodes = []; do { if ($node !== $this->getNode(0) && 1 === $node->nodeType) { @@ -973,14 +1099,11 @@ protected function sibling($node, $siblingDir = 'nextSibling') } /** - * @param \DOMDocument $document - * @param array $prefixes - * * @return \DOMXPath * * @throws \InvalidArgumentException */ - private function createDOMXPath(\DOMDocument $document, array $prefixes = array()) + private function createDOMXPath(\DOMDocument $document, array $prefixes = []) { $domxpath = new \DOMXPath($document); @@ -995,10 +1118,9 @@ private function createDOMXPath(\DOMDocument $document, array $prefixes = array( } /** - * @param \DOMXPath $domxpath - * @param string $prefix + * @param string $prefix * - * @return string + * @return string|null * * @throws \InvalidArgumentException */ @@ -1011,9 +1133,7 @@ private function discoverNamespace(\DOMXPath $domxpath, $prefix) // ask for one namespace, otherwise we'd get a collection with an item for each node $namespaces = $domxpath->query(sprintf('(//namespace::*[name()="%s"])[last()]', $this->defaultNamespacePrefix === $prefix ? '' : $prefix)); - if ($node = $namespaces->item(0)) { - return $node->nodeValue; - } + return ($node = $namespaces->item(0)) ? $node->nodeValue : null; } /** @@ -1027,18 +1147,23 @@ private function findNamespacePrefixes($xpath) return array_unique($matches['prefix']); } - return array(); + return []; } /** * Creates a crawler for some subnodes. * - * @param \DOMElement|\DOMElement[]|\DOMNodeList|null $nodes + * @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $nodes * * @return static */ private function createSubCrawler($nodes) { - return new static($nodes, $this->uri, $this->baseHref); + $crawler = new static($nodes, $this->uri, $this->baseHref); + $crawler->isHtml = $this->isHtml; + $crawler->document = $this->document; + $crawler->namespaces = $this->namespaces; + + return $crawler; } } diff --git a/application/vendor/symfony/dom-crawler/Field/ChoiceFormField.php b/application/vendor/symfony/dom-crawler/Field/ChoiceFormField.php index a3539bc..a7d2b84 100644 --- a/application/vendor/symfony/dom-crawler/Field/ChoiceFormField.php +++ b/application/vendor/symfony/dom-crawler/Field/ChoiceFormField.php @@ -45,7 +45,7 @@ class ChoiceFormField extends FormField public function hasValue() { // don't send a value for unchecked checkboxes - if (in_array($this->type, array('checkbox', 'radio')) && null === $this->value) { + if (\in_array($this->type, ['checkbox', 'radio']) && null === $this->value) { return false; } @@ -75,7 +75,7 @@ public function isDisabled() /** * Sets the value of the field. * - * @param string $value The value of the field + * @param string|array $value The value of the field */ public function select($value) { @@ -113,7 +113,7 @@ public function untick() /** * Sets the value of the field. * - * @param string|array $value The value of the field + * @param string|array|bool $value The value of the field * * @throws \InvalidArgumentException When value type provided is not correct */ @@ -126,25 +126,25 @@ public function setValue($value) // check $this->value = $this->options[0]['value']; } else { - if (is_array($value)) { + if (\is_array($value)) { if (!$this->multiple) { throw new \InvalidArgumentException(sprintf('The value for "%s" cannot be an array.', $this->name)); } foreach ($value as $v) { if (!$this->containsOption($v, $this->options)) { - throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: %s).', $this->name, $v, implode(', ', $this->availableOptionValues()))); + throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $v, implode('", "', $this->availableOptionValues()))); } } } elseif (!$this->containsOption($value, $this->options)) { - throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: %s).', $this->name, $value, implode(', ', $this->availableOptionValues()))); + throw new \InvalidArgumentException(sprintf('Input "%s" cannot take "%s" as a value (possible values: "%s").', $this->name, $value, implode('", "', $this->availableOptionValues()))); } if ($this->multiple) { $value = (array) $value; } - if (is_array($value)) { + if (\is_array($value)) { $this->value = $value; } else { parent::setValue($value); @@ -155,8 +155,6 @@ public function setValue($value) /** * Adds a choice to the current ones. * - * @param \DOMElement $node - * * @throws \LogicException When choice provided is not multiple nor radio * * @internal @@ -207,11 +205,11 @@ protected function initialize() } if ('input' === $this->node->nodeName && 'checkbox' !== strtolower($this->node->getAttribute('type')) && 'radio' !== strtolower($this->node->getAttribute('type'))) { - throw new \LogicException(sprintf('A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is %s).', $this->node->getAttribute('type'))); + throw new \LogicException(sprintf('A ChoiceFormField can only be created from an input tag with a type of checkbox or radio (given type is "%s").', $this->node->getAttribute('type'))); } $this->value = null; - $this->options = array(); + $this->options = []; $this->multiple = false; if ('input' == $this->node->nodeName) { @@ -226,7 +224,7 @@ protected function initialize() $this->type = 'select'; if ($this->node->hasAttribute('multiple')) { $this->multiple = true; - $this->value = array(); + $this->value = []; $this->name = str_replace('[]', '', $this->name); } @@ -255,13 +253,11 @@ protected function initialize() /** * Returns option value with associated disabled flag. * - * @param \DOMElement $node - * * @return array */ private function buildOptionValue(\DOMElement $node) { - $option = array(); + $option = []; $defaultDefaultValue = 'select' === $this->node->nodeName ? '' : 'on'; $defaultValue = (isset($node->nodeValue) && !empty($node->nodeValue)) ? $node->nodeValue : $defaultDefaultValue; @@ -301,7 +297,7 @@ public function containsOption($optionValue, $options) */ public function availableOptionValues() { - $values = array(); + $values = []; foreach ($this->options as $option) { $values[] = $option['value']; diff --git a/application/vendor/symfony/dom-crawler/Field/FileFormField.php b/application/vendor/symfony/dom-crawler/Field/FileFormField.php index 0e0f943..3d0b22f 100644 --- a/application/vendor/symfony/dom-crawler/Field/FileFormField.php +++ b/application/vendor/symfony/dom-crawler/Field/FileFormField.php @@ -27,12 +27,12 @@ class FileFormField extends FormField */ public function setErrorCode($error) { - $codes = array(UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION); - if (!in_array($error, $codes)) { - throw new \InvalidArgumentException(sprintf('The error code %s is not valid.', $error)); + $codes = [\UPLOAD_ERR_INI_SIZE, \UPLOAD_ERR_FORM_SIZE, \UPLOAD_ERR_PARTIAL, \UPLOAD_ERR_NO_FILE, \UPLOAD_ERR_NO_TMP_DIR, \UPLOAD_ERR_CANT_WRITE, \UPLOAD_ERR_EXTENSION]; + if (!\in_array($error, $codes)) { + throw new \InvalidArgumentException(sprintf('The error code "%s" is not valid.', $error)); } - $this->value = array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0); + $this->value = ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => $error, 'size' => 0]; } /** @@ -48,19 +48,19 @@ public function upload($value) /** * Sets the value of the field. * - * @param string $value The value of the field + * @param string|null $value The value of the field */ public function setValue($value) { if (null !== $value && is_readable($value)) { - $error = UPLOAD_ERR_OK; + $error = \UPLOAD_ERR_OK; $size = filesize($value); $info = pathinfo($value); $name = $info['basename']; // copy to a tmp location - $tmp = sys_get_temp_dir().'/'.sha1(uniqid(mt_rand(), true)); - if (array_key_exists('extension', $info)) { + $tmp = sys_get_temp_dir().'/'.strtr(substr(base64_encode(hash('sha256', uniqid(mt_rand(), true), true)), 0, 7), '/', '_'); + if (\array_key_exists('extension', $info)) { $tmp .= '.'.$info['extension']; } if (is_file($tmp)) { @@ -69,13 +69,13 @@ public function setValue($value) copy($value, $tmp); $value = $tmp; } else { - $error = UPLOAD_ERR_NO_FILE; + $error = \UPLOAD_ERR_NO_FILE; $size = 0; $name = ''; $value = ''; } - $this->value = array('name' => $name, 'type' => '', 'tmp_name' => $value, 'error' => $error, 'size' => $size); + $this->value = ['name' => $name, 'type' => '', 'tmp_name' => $value, 'error' => $error, 'size' => $size]; } /** @@ -100,7 +100,7 @@ protected function initialize() } if ('file' !== strtolower($this->node->getAttribute('type'))) { - throw new \LogicException(sprintf('A FileFormField can only be created from an input tag with a type of file (given type is %s).', $this->node->getAttribute('type'))); + throw new \LogicException(sprintf('A FileFormField can only be created from an input tag with a type of file (given type is "%s").', $this->node->getAttribute('type'))); } $this->setValue(null); diff --git a/application/vendor/symfony/dom-crawler/Field/FormField.php b/application/vendor/symfony/dom-crawler/Field/FormField.php index 496d45d..0bc4f54 100644 --- a/application/vendor/symfony/dom-crawler/Field/FormField.php +++ b/application/vendor/symfony/dom-crawler/Field/FormField.php @@ -55,6 +55,27 @@ public function __construct(\DOMElement $node) $this->initialize(); } + /** + * Returns the label tag associated to the field or null if none. + * + * @return \DOMElement|null + */ + public function getLabel() + { + $xpath = new \DOMXPath($this->node->ownerDocument); + + if ($this->node->hasAttribute('id')) { + $labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id'))); + if ($labels->length > 0) { + return $labels->item(0); + } + } + + $labels = $xpath->query('ancestor::label[1]', $this->node); + + return $labels->length > 0 ? $labels->item(0) : null; + } + /** * Returns the name of the field. * @@ -78,7 +99,7 @@ public function getValue() /** * Sets the value of the field. * - * @param string $value The value of the field + * @param string|array|bool|null $value The value of the field */ public function setValue($value) { diff --git a/application/vendor/symfony/dom-crawler/Form.php b/application/vendor/symfony/dom-crawler/Form.php index 258be96..7c85ec6 100644 --- a/application/vendor/symfony/dom-crawler/Form.php +++ b/application/vendor/symfony/dom-crawler/Form.php @@ -87,7 +87,7 @@ public function setValues(array $values) */ public function getValues() { - $values = array(); + $values = []; foreach ($this->fields->all() as $name => $field) { if ($field->isDisabled()) { continue; @@ -108,11 +108,11 @@ public function getValues() */ public function getFiles() { - if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH'))) { - return array(); + if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) { + return []; } - $files = array(); + $files = []; foreach ($this->fields->all() as $name => $field) { if ($field->isDisabled()) { @@ -137,13 +137,13 @@ public function getFiles() */ public function getPhpValues() { - $values = array(); + $values = []; foreach ($this->getValues() as $name => $value) { - $qs = http_build_query(array($name => $value), '', '&'); + $qs = http_build_query([$name => $value], '', '&'); if (!empty($qs)) { parse_str($qs, $expandedValue); - $varName = substr($name, 0, strlen(key($expandedValue))); - $values = array_replace_recursive($values, array($varName => current($expandedValue))); + $varName = substr($name, 0, \strlen(key($expandedValue))); + $values = array_replace_recursive($values, [$varName => current($expandedValue)]); } } @@ -164,12 +164,12 @@ public function getPhpValues() */ public function getPhpFiles() { - $values = array(); + $values = []; foreach ($this->getFiles() as $name => $value) { - $qs = http_build_query(array($name => $value), '', '&'); + $qs = http_build_query([$name => $value], '', '&'); if (!empty($qs)) { parse_str($qs, $expandedValue); - $varName = substr($name, 0, strlen(key($expandedValue))); + $varName = substr($name, 0, \strlen(key($expandedValue))); array_walk_recursive( $expandedValue, @@ -182,7 +182,7 @@ function (&$value, $key) { reset($expandedValue); - $values = array_replace_recursive($values, array($varName => current($expandedValue))); + $values = array_replace_recursive($values, [$varName => current($expandedValue)]); } } @@ -202,9 +202,9 @@ public function getUri() { $uri = parent::getUri(); - if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH'))) { - $query = parse_url($uri, PHP_URL_QUERY); - $currentParameters = array(); + if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) { + $query = parse_url($uri, \PHP_URL_QUERY); + $currentParameters = []; if ($query) { parse_str($query, $currentParameters); } @@ -221,6 +221,11 @@ public function getUri() protected function getRawUri() { + // If the form was created from a button rather than the form node, check for HTML5 action overrides + if ($this->button !== $this->node && $this->button->getAttribute('formaction')) { + return $this->button->getAttribute('formaction'); + } + return $this->node->getAttribute('action'); } @@ -237,6 +242,11 @@ public function getMethod() return $this->method; } + // If the form was created from a button rather than the form node, check for HTML5 method override + if ($this->button !== $this->node && $this->button->getAttribute('formmethod')) { + return strtoupper($this->button->getAttribute('formmethod')); + } + return $this->node->getAttribute('method') ? strtoupper($this->node->getAttribute('method')) : 'GET'; } @@ -267,7 +277,7 @@ public function remove($name) * * @param string $name The field name * - * @return FormField The field instance + * @return FormField|FormField[]|FormField[][] The value of the field * * @throws \InvalidArgumentException When field is not present in this form */ @@ -311,7 +321,7 @@ public function offsetExists($name) * * @param string $name The field name * - * @return FormField The associated Field instance + * @return FormField|FormField[]|FormField[][] The value of the field * * @throws \InvalidArgumentException if the field does not exist */ @@ -369,7 +379,7 @@ public function disableValidation() protected function setNode(\DOMElement $node) { $this->button = $node; - if ('button' === $node->nodeName || ('input' === $node->nodeName && in_array(strtolower($node->getAttribute('type')), array('submit', 'button', 'image')))) { + if ('button' === $node->nodeName || ('input' === $node->nodeName && \in_array(strtolower($node->getAttribute('type')), ['submit', 'button', 'image']))) { if ($node->hasAttribute('form')) { // if the node has the HTML5-compliant 'form' attribute, use it $formId = $node->getAttribute('form'); @@ -433,14 +443,14 @@ private function initialize() // corresponding elements are either descendants or have a matching HTML5 form attribute $formId = Crawler::xpathLiteral($this->node->getAttribute('id')); - $fieldNodes = $xpath->query(sprintf('descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)]', $formId)); + $fieldNodes = $xpath->query(sprintf('( descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)] )[not(ancestor::template)]', $formId)); foreach ($fieldNodes as $node) { $this->addField($node); } } else { // do the xpath query with $this->node as the context node, to only find descendant elements // however, descendant elements with form attribute are not part of this form - $fieldNodes = $xpath->query('descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)]', $this->node); + $fieldNodes = $xpath->query('( descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)] )[not(ancestor::template)]', $this->node); foreach ($fieldNodes as $node) { $this->addField($node); } @@ -470,7 +480,7 @@ private function addField(\DOMElement $node) } } elseif ('input' == $nodeName && 'file' == strtolower($node->getAttribute('type'))) { $this->set(new Field\FileFormField($node)); - } elseif ('input' == $nodeName && !in_array(strtolower($node->getAttribute('type')), array('submit', 'button', 'image'))) { + } elseif ('input' == $nodeName && !\in_array(strtolower($node->getAttribute('type')), ['submit', 'button', 'image'])) { $this->set(new Field\InputFormField($node)); } elseif ('textarea' == $nodeName) { $this->set(new Field\TextareaFormField($node)); diff --git a/application/vendor/symfony/dom-crawler/FormFieldRegistry.php b/application/vendor/symfony/dom-crawler/FormFieldRegistry.php index 6ad6d93..af8bcfb 100644 --- a/application/vendor/symfony/dom-crawler/FormFieldRegistry.php +++ b/application/vendor/symfony/dom-crawler/FormFieldRegistry.php @@ -20,7 +20,7 @@ */ class FormFieldRegistry { - private $fields = array(); + private $fields = []; private $base; @@ -33,8 +33,8 @@ public function add(FormField $field) $target = &$this->fields; while ($segments) { - if (!is_array($target)) { - $target = array(); + if (!\is_array($target)) { + $target = []; } $path = array_shift($segments); if ('' === $path) { @@ -55,9 +55,9 @@ public function remove($name) { $segments = $this->getSegments($name); $target = &$this->fields; - while (count($segments) > 1) { + while (\count($segments) > 1) { $path = array_shift($segments); - if (!array_key_exists($path, $target)) { + if (!\is_array($target) || !\array_key_exists($path, $target)) { return; } $target = &$target[$path]; @@ -70,7 +70,7 @@ public function remove($name) * * @param string $name The fully qualified name of the field * - * @return mixed The value of the field + * @return FormField|FormField[]|FormField[][] The value of the field * * @throws \InvalidArgumentException if the field does not exist */ @@ -80,8 +80,8 @@ public function &get($name) $target = &$this->fields; while ($segments) { $path = array_shift($segments); - if (!array_key_exists($path, $target)) { - throw new \InvalidArgumentException(sprintf('Unreachable field "%s"', $path)); + if (!\is_array($target) || !\array_key_exists($path, $target)) { + throw new \InvalidArgumentException(sprintf('Unreachable field "%s".', $path)); } $target = &$target[$path]; } @@ -118,11 +118,13 @@ public function has($name) public function set($name, $value) { $target = &$this->get($name); - if ((!is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) { + if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) { $target->setValue($value); - } elseif (is_array($value)) { - $fields = self::create($name, $value); - foreach ($fields->all() as $k => $v) { + } elseif (\is_array($value)) { + $registry = new static(); + $registry->base = $name; + $registry->fields = $value; + foreach ($registry->all() as $k => $v) { $this->set($k, $v); } } else { @@ -133,33 +135,13 @@ public function set($name, $value) /** * Returns the list of field with their value. * - * @return FormField[] The list of fields as array((string) Fully qualified name => (mixed) value) + * @return FormField[] The list of fields as [string] Fully qualified name => (mixed) value) */ public function all() { return $this->walk($this->fields, $this->base); } - /** - * Creates an instance of the class. - * - * This function is made private because it allows overriding the $base and - * the $values properties without any type checking. - * - * @param string $base The fully qualified name of the base field - * @param array $values The values of the fields - * - * @return static - */ - private static function create($base, array $values) - { - $registry = new static(); - $registry->base = $base; - $registry->fields = $values; - - return $registry; - } - /** * Transforms a PHP array in a list of fully qualified name / value. * @@ -167,13 +149,13 @@ private static function create($base, array $values) * @param string $base The name of the base field * @param array $output The initial values * - * @return array The list of fields as array((string) Fully qualified name => (mixed) value) + * @return array The list of fields as [string] Fully qualified name => (mixed) value) */ - private function walk(array $array, $base = '', array &$output = array()) + private function walk(array $array, $base = '', array &$output = []) { foreach ($array as $k => $v) { $path = empty($base) ? $k : sprintf('%s[%s]', $base, $k); - if (is_array($v)) { + if (\is_array($v)) { $this->walk($v, $path, $output); } else { $output[$path] = $v; @@ -186,9 +168,7 @@ private function walk(array $array, $base = '', array &$output = array()) /** * Splits a field name into segments as a web browser would do. * - * - * getSegments('base[foo][3][]') = array('base', 'foo, '3', ''); - * + * getSegments('base[foo][3][]') = ['base', 'foo, '3', '']; * * @param string $name The name of the field * @@ -197,7 +177,7 @@ private function walk(array $array, $base = '', array &$output = array()) private function getSegments($name) { if (preg_match('/^(?P[^[]+)(?P(\[.*)|$)/', $name, $m)) { - $segments = array($m['base']); + $segments = [$m['base']]; while (!empty($m['extra'])) { $extra = $m['extra']; if (preg_match('/^\[(?P.*?)\](?P.*)$/', $extra, $m)) { @@ -210,6 +190,6 @@ private function getSegments($name) return $segments; } - return array($name); + return [$name]; } } diff --git a/application/vendor/symfony/dom-crawler/Image.php b/application/vendor/symfony/dom-crawler/Image.php new file mode 100644 index 0000000..4d64032 --- /dev/null +++ b/application/vendor/symfony/dom-crawler/Image.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DomCrawler; + +/** + * Image represents an HTML image (an HTML img tag). + */ +class Image extends AbstractUriElement +{ + public function __construct(\DOMElement $node, $currentUri) + { + parent::__construct($node, $currentUri, 'GET'); + } + + protected function getRawUri() + { + return $this->node->getAttribute('src'); + } + + protected function setNode(\DOMElement $node) + { + if ('img' !== $node->nodeName) { + throw new \LogicException(sprintf('Unable to visualize a "%s" tag.', $node->nodeName)); + } + + $this->node = $node; + } +} diff --git a/application/vendor/symfony/dom-crawler/LICENSE b/application/vendor/symfony/dom-crawler/LICENSE index 21d7fb9..9e936ec 100644 --- a/application/vendor/symfony/dom-crawler/LICENSE +++ b/application/vendor/symfony/dom-crawler/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2020 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/application/vendor/symfony/dom-crawler/Link.php b/application/vendor/symfony/dom-crawler/Link.php index b68f246..80a356e 100644 --- a/application/vendor/symfony/dom-crawler/Link.php +++ b/application/vendor/symfony/dom-crawler/Link.php @@ -16,157 +16,13 @@ * * @author Fabien Potencier */ -class Link +class Link extends AbstractUriElement { - /** - * @var \DOMElement - */ - protected $node; - - /** - * @var string The method to use for the link - */ - protected $method; - - /** - * @var string The URI of the page where the link is embedded (or the base href) - */ - protected $currentUri; - - /** - * @param \DOMElement $node A \DOMElement instance - * @param string $currentUri The URI of the page where the link is embedded (or the base href) - * @param string $method The method to use for the link (get by default) - * - * @throws \InvalidArgumentException if the node is not a link - */ - public function __construct(\DOMElement $node, $currentUri, $method = 'GET') - { - if (!in_array(strtolower(substr($currentUri, 0, 4)), array('http', 'file'))) { - throw new \InvalidArgumentException(sprintf('Current URI must be an absolute URL ("%s").', $currentUri)); - } - - $this->setNode($node); - $this->method = $method ? strtoupper($method) : null; - $this->currentUri = $currentUri; - } - - /** - * Gets the node associated with this link. - * - * @return \DOMElement A \DOMElement instance - */ - public function getNode() - { - return $this->node; - } - - /** - * Gets the method associated with this link. - * - * @return string The method - */ - public function getMethod() - { - return $this->method; - } - - /** - * Gets the URI associated with this link. - * - * @return string The URI - */ - public function getUri() - { - $uri = trim($this->getRawUri()); - - // absolute URL? - if (null !== parse_url($uri, PHP_URL_SCHEME)) { - return $uri; - } - - // empty URI - if (!$uri) { - return $this->currentUri; - } - - // an anchor - if ('#' === $uri[0]) { - return $this->cleanupAnchor($this->currentUri).$uri; - } - - $baseUri = $this->cleanupUri($this->currentUri); - - if ('?' === $uri[0]) { - return $baseUri.$uri; - } - - // absolute URL with relative schema - if (0 === strpos($uri, '//')) { - return preg_replace('#^([^/]*)//.*$#', '$1', $baseUri).$uri; - } - - $baseUri = preg_replace('#^(.*?//[^/]*)(?:\/.*)?$#', '$1', $baseUri); - - // absolute path - if ('/' === $uri[0]) { - return $baseUri.$uri; - } - - // relative path - $path = parse_url(substr($this->currentUri, strlen($baseUri)), PHP_URL_PATH); - $path = $this->canonicalizePath(substr($path, 0, strrpos($path, '/')).'/'.$uri); - - return $baseUri.('' === $path || '/' !== $path[0] ? '/' : '').$path; - } - - /** - * Returns raw URI data. - * - * @return string - */ protected function getRawUri() { return $this->node->getAttribute('href'); } - /** - * Returns the canonicalized URI path (see RFC 3986, section 5.2.4). - * - * @param string $path URI path - * - * @return string - */ - protected function canonicalizePath($path) - { - if ('' === $path || '/' === $path) { - return $path; - } - - if ('.' === substr($path, -1)) { - $path .= '/'; - } - - $output = array(); - - foreach (explode('/', $path) as $segment) { - if ('..' === $segment) { - array_pop($output); - } elseif ('.' !== $segment) { - $output[] = $segment; - } - } - - return implode('/', $output); - } - - /** - * Sets current \DOMElement instance. - * - * @param \DOMElement $node A \DOMElement instance - * - * @throws \LogicException If given node is not an anchor - */ protected function setNode(\DOMElement $node) { if ('a' !== $node->nodeName && 'area' !== $node->nodeName && 'link' !== $node->nodeName) { @@ -175,48 +31,4 @@ protected function setNode(\DOMElement $node) $this->node = $node; } - - /** - * Removes the query string and the anchor from the given uri. - * - * @param string $uri The uri to clean - * - * @return string - */ - private function cleanupUri($uri) - { - return $this->cleanupQuery($this->cleanupAnchor($uri)); - } - - /** - * Remove the query string from the uri. - * - * @param string $uri - * - * @return string - */ - private function cleanupQuery($uri) - { - if (false !== $pos = strpos($uri, '?')) { - return substr($uri, 0, $pos); - } - - return $uri; - } - - /** - * Remove the anchor from the uri. - * - * @param string $uri - * - * @return string - */ - private function cleanupAnchor($uri) - { - if (false !== $pos = strpos($uri, '#')) { - return substr($uri, 0, $pos); - } - - return $uri; - } } diff --git a/application/vendor/symfony/dom-crawler/Tests/CrawlerTest.php b/application/vendor/symfony/dom-crawler/Tests/CrawlerTest.php index 74acfdf..26164dc 100644 --- a/application/vendor/symfony/dom-crawler/Tests/CrawlerTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/CrawlerTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\DomCrawler\Tests; use PHPUnit\Framework\TestCase; -use Symfony\Component\CssSelector\CssSelector; use Symfony\Component\DomCrawler\Crawler; class CrawlerTest extends TestCase @@ -22,10 +21,27 @@ public function testConstructor() $crawler = new Crawler(); $this->assertCount(0, $crawler, '__construct() returns an empty crawler'); - $crawler = new Crawler(new \DOMNode()); + $doc = new \DOMDocument(); + $node = $doc->createElement('test'); + + $crawler = new Crawler($node); $this->assertCount(1, $crawler, '__construct() takes a node as a first argument'); } + public function testGetUri() + { + $uri = 'http://symfony.com'; + $crawler = new Crawler(null, $uri); + $this->assertEquals($uri, $crawler->getUri()); + } + + public function testGetBaseHref() + { + $baseHref = 'http://symfony.com'; + $crawler = new Crawler(null, null, $baseHref); + $this->assertEquals($baseHref, $crawler->getBaseHref()); + } + public function testAdd() { $crawler = new Crawler(); @@ -36,6 +52,7 @@ public function testAdd() $crawler->add($this->createNodeList()); $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMNodeList'); + $list = []; foreach ($this->createNodeList() as $node) { $list[] = $node; } @@ -45,28 +62,39 @@ public function testAdd() $crawler = new Crawler(); $crawler->add($this->createNodeList()->item(0)); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMElement'); + $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->add() adds nodes from a \DOMNode'); $crawler = new Crawler(); $crawler->add('Foo'); $this->assertEquals('Foo', $crawler->filterXPath('//body')->text(), '->add() adds nodes from a string'); } - /** - * @expectedException \InvalidArgumentException - */ - public function testAddInvalidNode() + public function testAddInvalidType() { + $this->expectException('InvalidArgumentException'); $crawler = new Crawler(); $crawler->add(1); } + public function testAddMultipleDocumentNode() + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Attaching DOM nodes from multiple documents in the same crawler is forbidden.'); + $crawler = $this->createTestCrawler(); + $crawler->addHtmlContent('
    ', 'UTF-8'); + } + public function testAddHtmlContent() { $crawler = new Crawler(); $crawler->addHtmlContent('
    ', 'UTF-8'); $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addHtmlContent() adds nodes from an HTML string'); + } + + public function testAddHtmlContentWithBaseTag() + { + $crawler = new Crawler(); $crawler->addHtmlContent('', 'UTF-8'); @@ -237,6 +265,7 @@ public function testAddNodeList() public function testAddNodes() { + $list = []; foreach ($this->createNodeList() as $node) { $list[] = $node; } @@ -252,12 +281,15 @@ public function testAddNode() $crawler = new Crawler(); $crawler->addNode($this->createNodeList()->item(0)); - $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNode() adds nodes from a \DOMElement'); + $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNode() adds nodes from a \DOMNode'); } public function testClear() { - $crawler = new Crawler(new \DOMNode()); + $doc = new \DOMDocument(); + $node = $doc->createElement('test'); + + $crawler = new Crawler($node); $crawler->clear(); $this->assertCount(0, $crawler, '->clear() removes all the nodes from the crawler'); } @@ -278,7 +310,15 @@ public function testEach() return $i.'-'.$node->text(); }); - $this->assertEquals(array('0-One', '1-Two', '2-Three'), $data, '->each() executes an anonymous function on each node of the list'); + $this->assertEquals(['0-One', '1-Two', '2-Three'], $data, '->each() executes an anonymous function on each node of the list'); + } + + public function testIteration() + { + $crawler = $this->createTestCrawler()->filterXPath('//li'); + + $this->assertInstanceOf('Traversable', $crawler); + $this->assertContainsOnlyInstancesOf('DOMElement', iterator_to_array($crawler), 'Iterating a Crawler gives DOMElement instances'); } public function testSlice() @@ -367,11 +407,11 @@ public function testExtract() { $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); - $this->assertEquals(array('One', 'Two', 'Three'), $crawler->extract('_text'), '->extract() returns an array of extracted data from the node list'); - $this->assertEquals(array(array('One', 'first'), array('Two', ''), array('Three', '')), $crawler->extract(array('_text', 'class')), '->extract() returns an array of extracted data from the node list'); - $this->assertEquals(array(array(), array(), array()), $crawler->extract(array()), '->extract() returns empty arrays if the attribute list is empty'); + $this->assertEquals(['One', 'Two', 'Three'], $crawler->extract('_text'), '->extract() returns an array of extracted data from the node list'); + $this->assertEquals([['One', 'first'], ['Two', ''], ['Three', '']], $crawler->extract(['_text', 'class']), '->extract() returns an array of extracted data from the node list'); + $this->assertEquals([[], [], []], $crawler->extract([]), '->extract() returns empty arrays if the attribute list is empty'); - $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->extract('_text'), '->extract() returns an empty array if the node list is empty'); + $this->assertEquals([], $this->createTestCrawler()->filterXPath('//ol')->extract('_text'), '->extract() returns an empty array if the node list is empty'); } public function testFilterXpathComplexQueries() @@ -380,7 +420,6 @@ public function testFilterXpathComplexQueries() $this->assertCount(0, $crawler->filterXPath('/input')); $this->assertCount(0, $crawler->filterXPath('/body')); - $this->assertCount(1, $crawler->filterXPath('/_root/body')); $this->assertCount(1, $crawler->filterXPath('./body')); $this->assertCount(1, $crawler->filterXPath('.//body')); $this->assertCount(5, $crawler->filterXPath('.//input')); @@ -411,6 +450,12 @@ public function testFilterXPath() $this->assertCount(3, $crawler->filterXPath('//body')->filterXPath('//button')->parents(), '->filterXpath() preserves parents when chained'); } + public function testFilterRemovesDuplicates() + { + $crawler = $this->createTestCrawler()->filter('html, body')->filter('li'); + $this->assertCount(6, $crawler, 'The crawler removes duplicates when filtering.'); + } + public function testFilterXPathWithDefaultNamespace() { $crawler = $this->createTestXmlCrawler()->filterXPath('//default:entry/default:id'); @@ -464,7 +509,6 @@ public function testFilterXPathWithFakeRoot() { $crawler = $this->createTestCrawler(); $this->assertCount(0, $crawler->filterXPath('.'), '->filterXPath() returns an empty result if the XPath references the fake root node'); - $this->assertCount(0, $crawler->filterXPath('/_root'), '->filterXPath() returns an empty result if the XPath references the fake root node'); $this->assertCount(0, $crawler->filterXPath('self::*'), '->filterXPath() returns an empty result if the XPath references the fake root node'); $this->assertCount(0, $crawler->filterXPath('self::_root'), '->filterXPath() returns an empty result if the XPath references the fake root node'); } @@ -580,16 +624,12 @@ public function testFilterWithDefaultNamespace() public function testFilterWithNamespace() { - CssSelector::disableHtmlExtension(); - $crawler = $this->createTestXmlCrawler()->filter('yt|accessControl'); $this->assertCount(2, $crawler, '->filter() automatically registers namespaces'); } public function testFilterWithMultipleNamespaces() { - CssSelector::disableHtmlExtension(); - $crawler = $this->createTestXmlCrawler()->filter('media|group yt|aspectRatio'); $this->assertCount(1, $crawler, '->filter() automatically registers namespaces'); $this->assertSame('widescreen', $crawler->text()); @@ -636,6 +676,17 @@ public function testSelectLink() $this->assertCount(4, $crawler->selectLink('Bar'), '->selectLink() selects links by the node values'); } + public function testSelectImage() + { + $crawler = $this->createTestCrawler(); + $this->assertNotSame($crawler, $crawler->selectImage('Bar'), '->selectImage() returns a new instance of a crawler'); + $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectImage() returns a new instance of a crawler'); + + $this->assertCount(1, $crawler->selectImage('Fabien\'s Bar'), '->selectImage() selects images by alt attribute'); + $this->assertCount(2, $crawler->selectImage('Fabien"s Bar'), '->selectImage() selects images by alt attribute'); + $this->assertCount(1, $crawler->selectImage('\' Fabien"s Bar'), '->selectImage() selects images by alt attribute'); + } + public function testSelectButton() { $crawler = $this->createTestCrawler(); @@ -714,6 +765,35 @@ public function testLink() } } + public function testInvalidLink() + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('The selected node should be instance of DOMElement'); + $crawler = $this->createTestCrawler('http://example.com/bar/'); + $crawler->filterXPath('//li/text()')->link(); + } + + public function testInvalidLinks() + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('The selected node should be instance of DOMElement'); + $crawler = $this->createTestCrawler('http://example.com/bar/'); + $crawler->filterXPath('//li/text()')->link(); + } + + public function testImage() + { + $crawler = $this->createTestCrawler('http://example.com/bar/')->selectImage('Bar'); + $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Image', $crawler->image(), '->image() returns an Image instance'); + + try { + $this->createTestCrawler()->filterXPath('//ol')->image(); + $this->fail('->image() throws an \InvalidArgumentException if the node list is empty'); + } catch (\InvalidArgumentException $e) { + $this->assertTrue(true, '->image() throws an \InvalidArgumentException if the node list is empty'); + } + } + public function testSelectLinkAndLinkFiltered() { $html = <<<'HTML' @@ -755,13 +835,25 @@ public function testChaining() public function testLinks() { $crawler = $this->createTestCrawler('http://example.com/bar/')->selectLink('Foo'); - $this->assertInternalType('array', $crawler->links(), '->links() returns an array'); + $this->assertIsArray($crawler->links(), '->links() returns an array'); $this->assertCount(4, $crawler->links(), '->links() returns an array'); $links = $crawler->links(); $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Link', $links[0], '->links() returns an array of Link instances'); - $this->assertEquals(array(), $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty'); + $this->assertEquals([], $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty'); + } + + public function testImages() + { + $crawler = $this->createTestCrawler('http://example.com/bar/')->selectImage('Bar'); + $this->assertIsArray($crawler->images(), '->images() returns an array'); + + $this->assertCount(4, $crawler->images(), '->images() returns an array'); + $images = $crawler->images(); + $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Image', $images[0], '->images() returns an array of Image instances'); + + $this->assertEquals([], $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty'); } public function testForm() @@ -774,9 +866,9 @@ public function testForm() $this->assertEquals($crawler->form()->getFormNode()->getAttribute('id'), $crawler2->form()->getFormNode()->getAttribute('id'), '->form() works on elements with form attribute'); - $this->assertEquals(array('FooName' => 'FooBar', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form(array('FooName' => 'FooBar'))->getValues(), '->form() takes an array of values to submit as its first argument'); - $this->assertEquals(array('FooName' => 'FooValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form()->getValues(), '->getValues() returns correct form values'); - $this->assertEquals(array('FooBarName' => 'FooBarValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler2->form()->getValues(), '->getValues() returns correct form values'); + $this->assertEquals(['FooName' => 'FooBar', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'], $crawler->form(['FooName' => 'FooBar'])->getValues(), '->form() takes an array of values to submit as its first argument'); + $this->assertEquals(['FooName' => 'FooValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'], $crawler->form()->getValues(), '->getValues() returns correct form values'); + $this->assertEquals(['FooBarName' => 'FooBarValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'], $crawler2->form()->getValues(), '->getValues() returns correct form values'); try { $this->createTestCrawler()->filterXPath('//ol')->form(); @@ -786,6 +878,14 @@ public function testForm() } } + public function testInvalidForm() + { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('The selected node should be instance of DOMElement'); + $crawler = $this->createTestCrawler('http://example.com/bar/'); + $crawler->filterXPath('//li/text()')->form(); + } + public function testLast() { $crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li'); @@ -889,7 +989,7 @@ public function testChildren() $this->assertTrue(true, '->children() does not trigger a notice if the node has no children'); } catch (\PHPUnit\Framework\Error\Notice $e) { $this->fail('->children() does not trigger a notice if the node has no children'); - } catch (\PHPUnit_Framework_Error_Notice $e) { + } catch (\PHPUnit\Framework\Error\Notice $e) { $this->fail('->children() does not trigger a notice if the node has no children'); } } @@ -917,7 +1017,7 @@ public function testParents() /** * @dataProvider getBaseTagData */ - public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = null) + public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = '') { $crawler = new Crawler('', $currentUri); $this->assertEquals($expectedUri, $crawler->filterXPath('//a')->link()->getUri(), $description); @@ -925,13 +1025,13 @@ public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = public function getBaseTagData() { - return array( - array('http://base.com', 'link', 'http://base.com/link'), - array('//base.com', 'link', 'https://base.com/link', 'https://domain.com', ' tag can use a schema-less URL'), - array('path/', 'link', 'https://domain.com/path/link', 'https://domain.com', ' tag can set a path'), - array('http://base.com', '#', 'http://base.com#', 'http://domain.com/path/link', ' tag does work with links to an anchor'), - array('http://base.com', '', 'http://base.com', 'http://domain.com/path/link', ' tag does work with empty links'), - ); + return [ + ['http://base.com', 'link', 'http://base.com/link'], + ['//base.com', 'link', 'https://base.com/link', 'https://domain.com', ' tag can use a schema-less URL'], + ['path/', 'link', 'https://domain.com/path/link', 'https://domain.com', ' tag can set a path'], + ['http://base.com', '#', 'http://base.com#', 'http://domain.com/path/link', ' tag does work with links to an anchor'], + ['http://base.com', '', 'http://base.com', 'http://domain.com/path/link', ' tag does work with empty links'], + ]; } /** @@ -945,14 +1045,14 @@ public function testBaseTagWithForm($baseValue, $actionValue, $expectedUri, $cur public function getBaseTagWithFormData() { - return array( - array('https://base.com/', 'link/', 'https://base.com/link/', 'https://base.com/link/', ' tag does work with a path and relative form action'), - array('/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and form action'), - array('/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and empty form action'), - array('http://base.com/', '/registration', 'http://base.com/registration', 'http://domain.com/registration', ' tag does work with a URL and form action'), - array('http://base.com', '', 'http://domain.com/path/form', 'http://domain.com/path/form', ' tag does work with a URL and an empty form action'), - array('http://base.com/path', '/registration', 'http://base.com/registration', 'http://domain.com/path/form', ' tag does work with a URL and form action'), - ); + return [ + ['https://base.com/', 'link/', 'https://base.com/link/', 'https://base.com/link/', ' tag does work with a path and relative form action'], + ['/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and form action'], + ['/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and empty form action'], + ['http://base.com/', '/registration', 'http://base.com/registration', 'http://domain.com/registration', ' tag does work with a URL and form action'], + ['http://base.com', '', 'http://domain.com/path/form', 'http://domain.com/path/form', ' tag does work with a URL and an empty form action'], + ['http://base.com/path', '/registration', 'http://base.com/registration', 'http://domain.com/path/form', ' tag does work with a URL and form action'], + ]; } public function testCountOfNestedElements() @@ -962,6 +1062,49 @@ public function testCountOfNestedElements() $this->assertCount(1, $crawler->filter('li:contains("List item 1")')); } + public function testEvaluateReturnsTypedResultOfXPathExpressionOnADocumentSubset() + { + $crawler = $this->createTestCrawler(); + + $result = $crawler->filterXPath('//form/input')->evaluate('substring-before(@name, "Name")'); + + $this->assertSame(['Text', 'Foo', 'Bar'], $result); + } + + public function testEvaluateReturnsTypedResultOfNamespacedXPathExpressionOnADocumentSubset() + { + $crawler = $this->createTestXmlCrawler(); + + $result = $crawler->filterXPath('//yt:accessControl/@action')->evaluate('string(.)'); + + $this->assertSame(['comment', 'videoRespond'], $result); + } + + public function testEvaluateReturnsTypedResultOfNamespacedXPathExpression() + { + $crawler = $this->createTestXmlCrawler(); + $crawler->registerNamespace('youtube', 'http://gdata.youtube.com/schemas/2007'); + + $result = $crawler->evaluate('string(//youtube:accessControl/@action)'); + + $this->assertSame(['comment'], $result); + } + + public function testEvaluateReturnsACrawlerIfXPathExpressionEvaluatesToANode() + { + $crawler = $this->createTestCrawler()->evaluate('//form/input[1]'); + + $this->assertInstanceOf(Crawler::class, $crawler); + $this->assertCount(1, $crawler); + $this->assertSame('input', $crawler->first()->nodeName()); + } + + public function testEvaluateThrowsAnExceptionIfDocumentIsEmpty() + { + $this->expectException('LogicException'); + (new Crawler())->evaluate('//form/input[1]'); + } + public function createTestCrawler($uri = null) { $dom = new \DOMDocument(); diff --git a/application/vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php b/application/vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php index 9592286..176ea59 100644 --- a/application/vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/Field/ChoiceFormFieldTest.php @@ -19,15 +19,15 @@ public function testInitialize() { $node = $this->createNode('textarea', ''); try { - $field = new ChoiceFormField($node); + new ChoiceFormField($node); $this->fail('->initialize() throws a \LogicException if the node is not an input or a select'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is not an input or a select'); } - $node = $this->createNode('input', '', array('type' => 'text')); + $node = $this->createNode('input', '', ['type' => 'text']); try { - $field = new ChoiceFormField($node); + new ChoiceFormField($node); $this->fail('->initialize() throws a \LogicException if the node is an input with a type different from checkbox or radio'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is an input with a type different from checkbox or radio'); @@ -36,12 +36,12 @@ public function testInitialize() public function testGetType() { - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); $this->assertEquals('radio', $field->getType(), '->getType() returns radio for radio buttons'); - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); $this->assertEquals('checkbox', $field->getType(), '->getType() returns radio for a checkbox'); @@ -54,12 +54,12 @@ public function testGetType() public function testIsMultiple() { - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); $this->assertFalse($field->isMultiple(), '->isMultiple() returns false for radio buttons'); - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); $this->assertFalse($field->isMultiple(), '->isMultiple() returns false for checkboxes'); @@ -69,12 +69,12 @@ public function testIsMultiple() $this->assertFalse($field->isMultiple(), '->isMultiple() returns false for selects without the multiple attribute'); - $node = $this->createNode('select', '', array('multiple' => 'multiple')); + $node = $this->createNode('select', '', ['multiple' => 'multiple']); $field = new ChoiceFormField($node); $this->assertTrue($field->isMultiple(), '->isMultiple() returns true for selects with the multiple attribute'); - $node = $this->createNode('select', '', array('multiple' => '')); + $node = $this->createNode('select', '', ['multiple' => '']); $field = new ChoiceFormField($node); $this->assertTrue($field->isMultiple(), '->isMultiple() returns true for selects with an empty multiple attribute'); @@ -82,14 +82,14 @@ public function testIsMultiple() public function testSelects() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => false)); + $node = $this->createSelectNode(['foo' => false, 'bar' => false]); $field = new ChoiceFormField($node); $this->assertTrue($field->hasValue(), '->hasValue() returns true for selects'); $this->assertEquals('foo', $field->getValue(), '->getValue() returns the first option if none are selected'); $this->assertFalse($field->isMultiple(), '->isMultiple() returns false when no multiple attribute is defined'); - $node = $this->createSelectNode(array('foo' => false, 'bar' => true)); + $node = $this->createSelectNode(['foo' => false, 'bar' => true]); $field = new ChoiceFormField($node); $this->assertEquals('bar', $field->getValue(), '->getValue() returns the selected option'); @@ -105,7 +105,7 @@ public function testSelects() } try { - $field->setValue(array('foobar')); + $field->setValue(['foobar']); $this->fail('->setValue() throws an \InvalidArgumentException if the value is an array'); } catch (\InvalidArgumentException $e) { $this->assertTrue(true, '->setValue() throws an \InvalidArgumentException if the value is an array'); @@ -114,7 +114,7 @@ public function testSelects() public function testSelectWithEmptyBooleanAttribute() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => true), array(), ''); + $node = $this->createSelectNode(['foo' => false, 'bar' => true], [], ''); $field = new ChoiceFormField($node); $this->assertEquals('bar', $field->getValue()); @@ -122,7 +122,7 @@ public function testSelectWithEmptyBooleanAttribute() public function testSelectIsDisabled() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => true), array('disabled' => 'disabled')); + $node = $this->createSelectNode(['foo' => false, 'bar' => true], ['disabled' => 'disabled']); $field = new ChoiceFormField($node); $this->assertTrue($field->isDisabled(), '->isDisabled() returns true for selects with a disabled attribute'); @@ -130,27 +130,27 @@ public function testSelectIsDisabled() public function testMultipleSelects() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => false), array('multiple' => 'multiple')); + $node = $this->createSelectNode(['foo' => false, 'bar' => false], ['multiple' => 'multiple']); $field = new ChoiceFormField($node); - $this->assertEquals(array(), $field->getValue(), '->setValue() returns an empty array if multiple is true and no option is selected'); + $this->assertEquals([], $field->getValue(), '->setValue() returns an empty array if multiple is true and no option is selected'); $field->setValue('foo'); - $this->assertEquals(array('foo'), $field->getValue(), '->setValue() returns an array of options if multiple is true'); + $this->assertEquals(['foo'], $field->getValue(), '->setValue() returns an array of options if multiple is true'); $field->setValue('bar'); - $this->assertEquals(array('bar'), $field->getValue(), '->setValue() returns an array of options if multiple is true'); + $this->assertEquals(['bar'], $field->getValue(), '->setValue() returns an array of options if multiple is true'); - $field->setValue(array('foo', 'bar')); - $this->assertEquals(array('foo', 'bar'), $field->getValue(), '->setValue() returns an array of options if multiple is true'); + $field->setValue(['foo', 'bar']); + $this->assertEquals(['foo', 'bar'], $field->getValue(), '->setValue() returns an array of options if multiple is true'); - $node = $this->createSelectNode(array('foo' => true, 'bar' => true), array('multiple' => 'multiple')); + $node = $this->createSelectNode(['foo' => true, 'bar' => true], ['multiple' => 'multiple']); $field = new ChoiceFormField($node); - $this->assertEquals(array('foo', 'bar'), $field->getValue(), '->getValue() returns the selected options'); + $this->assertEquals(['foo', 'bar'], $field->getValue(), '->getValue() returns the selected options'); try { - $field->setValue(array('foobar')); + $field->setValue(['foobar']); $this->fail('->setValue() throws an \InvalidArgumentException if the value is not one of the options'); } catch (\InvalidArgumentException $e) { $this->assertTrue(true, '->setValue() throws an \InvalidArgumentException if the value is not one of the options'); @@ -159,18 +159,18 @@ public function testMultipleSelects() public function testRadioButtons() { - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'bar')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'bar']); $field->addChoice($node); $this->assertFalse($field->hasValue(), '->hasValue() returns false when no radio button is selected'); $this->assertNull($field->getValue(), '->getValue() returns null if no radio button is selected'); $this->assertFalse($field->isMultiple(), '->isMultiple() returns false for radio buttons'); - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'bar', 'checked' => 'checked')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'bar', 'checked' => 'checked']); $field->addChoice($node); $this->assertTrue($field->hasValue(), '->hasValue() returns true when a radio button is selected'); @@ -189,9 +189,9 @@ public function testRadioButtons() public function testRadioButtonsWithEmptyBooleanAttribute() { - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'foo']); $field = new ChoiceFormField($node); - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'bar', 'checked' => '')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'bar', 'checked' => '']); $field->addChoice($node); $this->assertTrue($field->hasValue(), '->hasValue() returns true when a radio button is selected'); @@ -200,11 +200,11 @@ public function testRadioButtonsWithEmptyBooleanAttribute() public function testRadioButtonIsDisabled() { - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo', 'disabled' => 'disabled')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'foo', 'disabled' => 'disabled']); $field = new ChoiceFormField($node); - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'bar')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'bar']); $field->addChoice($node); - $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'baz', 'disabled' => '')); + $node = $this->createNode('input', '', ['type' => 'radio', 'name' => 'name', 'value' => 'baz', 'disabled' => '']); $field->addChoice($node); $field->select('foo'); @@ -222,7 +222,7 @@ public function testRadioButtonIsDisabled() public function testCheckboxes() { - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name']); $field = new ChoiceFormField($node); $this->assertFalse($field->hasValue(), '->hasValue() returns false when the checkbox is not checked'); @@ -235,18 +235,18 @@ public function testCheckboxes() $this->assertTrue(true, '->initialize() throws a \LogicException for checkboxes'); } - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'checked' => 'checked')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'checked' => 'checked']); $field = new ChoiceFormField($node); $this->assertTrue($field->hasValue(), '->hasValue() returns true when the checkbox is checked'); $this->assertEquals('on', $field->getValue(), '->getValue() returns 1 if the checkbox is checked and has no value attribute'); - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'checked' => 'checked', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'checked' => 'checked', 'value' => 'foo']); $field = new ChoiceFormField($node); $this->assertEquals('foo', $field->getValue(), '->getValue() returns the value attribute if the checkbox is checked'); - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'checked' => 'checked', 'value' => 'foo')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'checked' => 'checked', 'value' => 'foo']); $field = new ChoiceFormField($node); $field->setValue(false); @@ -265,7 +265,7 @@ public function testCheckboxes() public function testCheckboxWithEmptyBooleanAttribute() { - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'value' => 'foo', 'checked' => '')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'value' => 'foo', 'checked' => '']); $field = new ChoiceFormField($node); $this->assertTrue($field->hasValue(), '->hasValue() returns true when the checkbox is checked'); @@ -274,7 +274,7 @@ public function testCheckboxWithEmptyBooleanAttribute() public function testTick() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => false)); + $node = $this->createSelectNode(['foo' => false, 'bar' => false]); $field = new ChoiceFormField($node); try { @@ -284,7 +284,7 @@ public function testTick() $this->assertTrue(true, '->tick() throws a \LogicException for select boxes'); } - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name']); $field = new ChoiceFormField($node); $field->tick(); $this->assertEquals('on', $field->getValue(), '->tick() ticks checkboxes'); @@ -292,7 +292,7 @@ public function testTick() public function testUntick() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => false)); + $node = $this->createSelectNode(['foo' => false, 'bar' => false]); $field = new ChoiceFormField($node); try { @@ -302,7 +302,7 @@ public function testUntick() $this->assertTrue(true, '->untick() throws a \LogicException for select boxes'); } - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'checked' => 'checked')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'checked' => 'checked']); $field = new ChoiceFormField($node); $field->untick(); $this->assertNull($field->getValue(), '->untick() unticks checkboxes'); @@ -310,14 +310,14 @@ public function testUntick() public function testSelect() { - $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name', 'checked' => 'checked')); + $node = $this->createNode('input', '', ['type' => 'checkbox', 'name' => 'name', 'checked' => 'checked']); $field = new ChoiceFormField($node); $field->select(true); $this->assertEquals('on', $field->getValue(), '->select() changes the value of the field'); $field->select(false); $this->assertNull($field->getValue(), '->select() changes the value of the field'); - $node = $this->createSelectNode(array('foo' => false, 'bar' => false)); + $node = $this->createSelectNode(['foo' => false, 'bar' => false]); $field = new ChoiceFormField($node); $field->select('foo'); $this->assertEquals('foo', $field->getValue(), '->select() changes the selected option'); @@ -325,11 +325,11 @@ public function testSelect() public function testOptionWithNoValue() { - $node = $this->createSelectNodeWithEmptyOption(array('foo' => false, 'bar' => false)); + $node = $this->createSelectNodeWithEmptyOption(['foo' => false, 'bar' => false]); $field = new ChoiceFormField($node); $this->assertEquals('foo', $field->getValue()); - $node = $this->createSelectNodeWithEmptyOption(array('foo' => false, 'bar' => true)); + $node = $this->createSelectNodeWithEmptyOption(['foo' => false, 'bar' => true]); $field = new ChoiceFormField($node); $this->assertEquals('bar', $field->getValue()); $field->select('foo'); @@ -338,28 +338,28 @@ public function testOptionWithNoValue() public function testDisableValidation() { - $node = $this->createSelectNode(array('foo' => false, 'bar' => false)); + $node = $this->createSelectNode(['foo' => false, 'bar' => false]); $field = new ChoiceFormField($node); $field->disableValidation(); $field->setValue('foobar'); $this->assertEquals('foobar', $field->getValue(), '->disableValidation() allows to set a value which is not in the selected options.'); - $node = $this->createSelectNode(array('foo' => false, 'bar' => false), array('multiple' => 'multiple')); + $node = $this->createSelectNode(['foo' => false, 'bar' => false], ['multiple' => 'multiple']); $field = new ChoiceFormField($node); $field->disableValidation(); - $field->setValue(array('foobar')); - $this->assertEquals(array('foobar'), $field->getValue(), '->disableValidation() allows to set a value which is not in the selected options.'); + $field->setValue(['foobar']); + $this->assertEquals(['foobar'], $field->getValue(), '->disableValidation() allows to set a value which is not in the selected options.'); } public function testSelectWithEmptyValue() { - $node = $this->createSelectNodeWithEmptyOption(array('' => true, 'Female' => false, 'Male' => false)); + $node = $this->createSelectNodeWithEmptyOption(['' => true, 'Female' => false, 'Male' => false]); $field = new ChoiceFormField($node); $this->assertSame('', $field->getValue()); } - protected function createSelectNode($options, $attributes = array(), $selectedAttrText = 'selected') + protected function createSelectNode($options, $attributes = [], $selectedAttrText = 'selected') { $document = new \DOMDocument(); $node = $document->createElement('select'); @@ -381,7 +381,7 @@ protected function createSelectNode($options, $attributes = array(), $selectedAt return $node; } - protected function createSelectNodeWithEmptyOption($options, $attributes = array()) + protected function createSelectNodeWithEmptyOption($options, $attributes = []) { $document = new \DOMDocument(); $node = $document->createElement('select'); diff --git a/application/vendor/symfony/dom-crawler/Tests/Field/FileFormFieldTest.php b/application/vendor/symfony/dom-crawler/Tests/Field/FileFormFieldTest.php index 3ce49a4..ef216aa 100644 --- a/application/vendor/symfony/dom-crawler/Tests/Field/FileFormFieldTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/Field/FileFormFieldTest.php @@ -17,22 +17,22 @@ class FileFormFieldTest extends FormFieldTestCase { public function testInitialize() { - $node = $this->createNode('input', '', array('type' => 'file')); + $node = $this->createNode('input', '', ['type' => 'file']); $field = new FileFormField($node); - $this->assertEquals(array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => UPLOAD_ERR_NO_FILE, 'size' => 0), $field->getValue(), '->initialize() sets the value of the field to no file uploaded'); + $this->assertEquals(['name' => '', 'type' => '', 'tmp_name' => '', 'error' => \UPLOAD_ERR_NO_FILE, 'size' => 0], $field->getValue(), '->initialize() sets the value of the field to no file uploaded'); $node = $this->createNode('textarea', ''); try { - $field = new FileFormField($node); + new FileFormField($node); $this->fail('->initialize() throws a \LogicException if the node is not an input field'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is not an input field'); } - $node = $this->createNode('input', '', array('type' => 'text')); + $node = $this->createNode('input', '', ['type' => 'text']); try { - $field = new FileFormField($node); + new FileFormField($node); $this->fail('->initialize() throws a \LogicException if the node is not a file input field'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is not a file input field'); @@ -44,18 +44,18 @@ public function testInitialize() */ public function testSetValue($method) { - $node = $this->createNode('input', '', array('type' => 'file')); + $node = $this->createNode('input', '', ['type' => 'file']); $field = new FileFormField($node); $field->$method(null); - $this->assertEquals(array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => UPLOAD_ERR_NO_FILE, 'size' => 0), $field->getValue(), "->$method() clears the uploaded file if the value is null"); + $this->assertEquals(['name' => '', 'type' => '', 'tmp_name' => '', 'error' => \UPLOAD_ERR_NO_FILE, 'size' => 0], $field->getValue(), "->$method() clears the uploaded file if the value is null"); $field->$method(__FILE__); $value = $field->getValue(); $this->assertEquals(basename(__FILE__), $value['name'], "->$method() sets the name of the file field"); $this->assertEquals('', $value['type'], "->$method() sets the type of the file field"); - $this->assertInternalType('string', $value['tmp_name'], "->$method() sets the tmp_name of the file field"); + $this->assertIsString($value['tmp_name'], "->$method() sets the tmp_name of the file field"); $this->assertFileExists($value['tmp_name'], "->$method() creates a copy of the file at the tmp_name path"); $this->assertEquals(0, $value['error'], "->$method() sets the error of the file field"); $this->assertEquals(filesize(__FILE__), $value['size'], "->$method() sets the size of the file field"); @@ -80,20 +80,20 @@ public function testSetValue($method) public function getSetValueMethods() { - return array( - array('setValue'), - array('upload'), - ); + return [ + ['setValue'], + ['upload'], + ]; } public function testSetErrorCode() { - $node = $this->createNode('input', '', array('type' => 'file')); + $node = $this->createNode('input', '', ['type' => 'file']); $field = new FileFormField($node); - $field->setErrorCode(UPLOAD_ERR_FORM_SIZE); + $field->setErrorCode(\UPLOAD_ERR_FORM_SIZE); $value = $field->getValue(); - $this->assertEquals(UPLOAD_ERR_FORM_SIZE, $value['error'], '->setErrorCode() sets the file input field error code'); + $this->assertEquals(\UPLOAD_ERR_FORM_SIZE, $value['error'], '->setErrorCode() sets the file input field error code'); try { $field->setErrorCode('foobar'); @@ -105,7 +105,7 @@ public function testSetErrorCode() public function testSetRawFilePath() { - $node = $this->createNode('input', '', array('type' => 'file')); + $node = $this->createNode('input', '', ['type' => 'file']); $field = new FileFormField($node); $field->setFilePath(__FILE__); diff --git a/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTest.php b/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTest.php index 510f762..e2daa03 100644 --- a/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTest.php @@ -17,7 +17,7 @@ class FormFieldTest extends FormFieldTestCase { public function testGetName() { - $node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value')); + $node = $this->createNode('input', '', ['type' => 'text', 'name' => 'name', 'value' => 'value']); $field = new InputFormField($node); $this->assertEquals('name', $field->getName(), '->getName() returns the name of the field'); @@ -25,7 +25,7 @@ public function testGetName() public function testGetSetHasValue() { - $node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value')); + $node = $this->createNode('input', '', ['type' => 'text', 'name' => 'name', 'value' => 'value']); $field = new InputFormField($node); $this->assertEquals('value', $field->getValue(), '->getValue() returns the value of the field'); @@ -35,4 +35,38 @@ public function testGetSetHasValue() $this->assertTrue($field->hasValue(), '->hasValue() always returns true'); } + + public function testLabelReturnsNullIfNoneIsDefined() + { + $dom = new \DOMDocument(); + $dom->loadHTML('
    '); + + $field = new InputFormField($dom->getElementById('foo')); + $this->assertNull($field->getLabel(), '->getLabel() returns null if no label is defined'); + } + + public function testLabelIsAssignedByForAttribute() + { + $dom = new \DOMDocument(); + $dom->loadHTML('
    + + + + '); + + $field = new InputFormField($dom->getElementById('foo')); + $this->assertEquals('Foo label', $field->getLabel()->textContent, '->getLabel() returns the associated label'); + } + + public function testLabelIsAssignedByParentingRelation() + { + $dom = new \DOMDocument(); + $dom->loadHTML('
    + + + '); + + $field = new InputFormField($dom->getElementById('foo')); + $this->assertEquals('Foo label', $field->getLabel()->textContent, '->getLabel() returns the parent label'); + } } diff --git a/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTestCase.php b/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTestCase.php index 2059d04..5ca19d9 100644 --- a/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTestCase.php +++ b/application/vendor/symfony/dom-crawler/Tests/Field/FormFieldTestCase.php @@ -15,7 +15,7 @@ class FormFieldTestCase extends TestCase { - protected function createNode($tag, $value, $attributes = array()) + protected function createNode($tag, $value, $attributes = []) { $document = new \DOMDocument(); $node = $document->createElement($tag, $value); diff --git a/application/vendor/symfony/dom-crawler/Tests/Field/InputFormFieldTest.php b/application/vendor/symfony/dom-crawler/Tests/Field/InputFormFieldTest.php index 193d301..a1f327b 100644 --- a/application/vendor/symfony/dom-crawler/Tests/Field/InputFormFieldTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/Field/InputFormFieldTest.php @@ -17,30 +17,30 @@ class InputFormFieldTest extends FormFieldTestCase { public function testInitialize() { - $node = $this->createNode('input', '', array('type' => 'text', 'name' => 'name', 'value' => 'value')); + $node = $this->createNode('input', '', ['type' => 'text', 'name' => 'name', 'value' => 'value']); $field = new InputFormField($node); $this->assertEquals('value', $field->getValue(), '->initialize() sets the value of the field to the value attribute value'); $node = $this->createNode('textarea', ''); try { - $field = new InputFormField($node); + new InputFormField($node); $this->fail('->initialize() throws a \LogicException if the node is not an input'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is not an input'); } - $node = $this->createNode('input', '', array('type' => 'checkbox')); + $node = $this->createNode('input', '', ['type' => 'checkbox']); try { - $field = new InputFormField($node); + new InputFormField($node); $this->fail('->initialize() throws a \LogicException if the node is a checkbox'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is a checkbox'); } - $node = $this->createNode('input', '', array('type' => 'file')); + $node = $this->createNode('input', '', ['type' => 'file']); try { - $field = new InputFormField($node); + new InputFormField($node); $this->fail('->initialize() throws a \LogicException if the node is a file'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is a file'); diff --git a/application/vendor/symfony/dom-crawler/Tests/Field/TextareaFormFieldTest.php b/application/vendor/symfony/dom-crawler/Tests/Field/TextareaFormFieldTest.php index 5d4d003..192984c 100644 --- a/application/vendor/symfony/dom-crawler/Tests/Field/TextareaFormFieldTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/Field/TextareaFormFieldTest.php @@ -24,7 +24,7 @@ public function testInitialize() $node = $this->createNode('input', ''); try { - $field = new TextareaFormField($node); + new TextareaFormField($node); $this->fail('->initialize() throws a \LogicException if the node is not a textarea'); } catch (\LogicException $e) { $this->assertTrue(true, '->initialize() throws a \LogicException if the node is not a textarea'); diff --git a/application/vendor/symfony/dom-crawler/Tests/FormTest.php b/application/vendor/symfony/dom-crawler/Tests/FormTest.php index 258a997..19f704e 100644 --- a/application/vendor/symfony/dom-crawler/Tests/FormTest.php +++ b/application/vendor/symfony/dom-crawler/Tests/FormTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DomCrawler\Tests; use PHPUnit\Framework\TestCase; +use Symfony\Component\DomCrawler\Field\TextareaFormField; use Symfony\Component\DomCrawler\Form; use Symfony\Component\DomCrawler\FormFieldRegistry; @@ -39,14 +40,14 @@ public function testConstructorThrowsExceptionIfTheNodeHasNoFormAncestor() $nodes = $dom->getElementsByTagName('input'); try { - $form = new Form($nodes->item(0), 'http://example.com'); + new Form($nodes->item(0), 'http://example.com'); $this->fail('__construct() throws a \\LogicException if the node has no form ancestor'); } catch (\LogicException $e) { $this->assertTrue(true, '__construct() throws a \\LogicException if the node has no form ancestor'); } try { - $form = new Form($nodes->item(1), 'http://example.com'); + new Form($nodes->item(1), 'http://example.com'); $this->fail('__construct() throws a \\LogicException if the input type is not submit, button, or image'); } catch (\LogicException $e) { $this->assertTrue(true, '__construct() throws a \\LogicException if the input type is not submit, button, or image'); @@ -55,7 +56,7 @@ public function testConstructorThrowsExceptionIfTheNodeHasNoFormAncestor() $nodes = $dom->getElementsByTagName('button'); try { - $form = new Form($nodes->item(0), 'http://example.com'); + new Form($nodes->item(0), 'http://example.com'); $this->fail('__construct() throws a \\LogicException if the node has no form ancestor'); } catch (\LogicException $e) { $this->assertTrue(true, '__construct() throws a \\LogicException if the node has no form ancestor'); @@ -63,11 +64,18 @@ public function testConstructorThrowsExceptionIfTheNodeHasNoFormAncestor() } /** - * __construct() should throw \\LogicException if the form attribute is invalid. + * @dataProvider constructorThrowsExceptionIfNoRelatedFormProvider * - * @expectedException \LogicException + * __construct() should throw a \LogicException if the form attribute is invalid. */ - public function testConstructorThrowsExceptionIfNoRelatedForm() + public function testConstructorThrowsExceptionIfNoRelatedForm(\DOMElement $node) + { + $this->expectException('LogicException'); + + new Form($node, 'http://example.com'); + } + + public function constructorThrowsExceptionIfNoRelatedFormProvider() { $dom = new \DOMDocument(); $dom->loadHTML(' @@ -82,8 +90,10 @@ public function testConstructorThrowsExceptionIfNoRelatedForm() $nodes = $dom->getElementsByTagName('input'); - $form = new Form($nodes->item(0), 'http://example.com'); - $form = new Form($nodes->item(1), 'http://example.com'); + return [ + [$nodes->item(0)], + [$nodes->item(1)], + ]; } public function testConstructorLoadsOnlyFieldsOfTheRightForm() @@ -129,18 +139,18 @@ public function testConstructorHandlesFormValues() $form2 = new Form($buttonElements->item(0), 'http://example.com'); // Tests if form values are correctly assigned to forms - $values1 = array( - 'apples' => array('1', '2'), + $values1 = [ + 'apples' => ['1', '2'], 'form_name' => 'form-1', 'button_1' => 'Capture fields', 'outer_field' => 'success', - ); - $values2 = array( - 'oranges' => array('1', '2', '3'), + ]; + $values2 = [ + 'oranges' => ['1', '2', '3'], 'form_name' => 'form_2', 'button_2' => '', - 'app_frontend_form_type_contact_form_type' => array('contactType' => '', 'firstName' => 'John'), - ); + 'app_frontend_form_type_contact_form_type' => ['contactType' => '', 'firstName' => 'John'], + ]; $this->assertEquals($values1, $form1->getPhpValues(), 'HTML5-compliant form attribute handled incorrectly'); $this->assertEquals($values2, $form2->getPhpValues(), 'HTML5-compliant form attribute handled incorrectly'); @@ -160,25 +170,28 @@ public function testMultiValuedFields() '); $this->assertEquals( - array_keys($form->all()), - array('foo[2]', 'foo[3]', 'bar[foo][0]', 'bar[foo][foobar]') + ['foo[2]', 'foo[3]', 'bar[foo][0]', 'bar[foo][foobar]'], + array_keys($form->all()) ); - $this->assertEquals($form->get('foo[2]')->getValue(), 'foo'); - $this->assertEquals($form->get('foo[3]')->getValue(), 'foo'); - $this->assertEquals($form->get('bar[foo][0]')->getValue(), 'foo'); - $this->assertEquals($form->get('bar[foo][foobar]')->getValue(), 'foo'); + $this->assertEquals('foo', $form->get('foo[2]')->getValue()); + $this->assertEquals('foo', $form->get('foo[3]')->getValue()); + $this->assertEquals('foo', $form->get('bar[foo][0]')->getValue()); + $this->assertEquals('foo', $form->get('bar[foo][foobar]')->getValue()); $form['foo[2]'] = 'bar'; $form['foo[3]'] = 'bar'; - $this->assertEquals($form->get('foo[2]')->getValue(), 'bar'); - $this->assertEquals($form->get('foo[3]')->getValue(), 'bar'); + $this->assertEquals('bar', $form->get('foo[2]')->getValue()); + $this->assertEquals('bar', $form->get('foo[3]')->getValue()); - $form['bar'] = array('foo' => array('0' => 'bar', 'foobar' => 'foobar')); + $form['bar'] = ['foo' => ['0' => 'bar', 'foobar' => 'foobar']]; - $this->assertEquals($form->get('bar[foo][0]')->getValue(), 'bar'); - $this->assertEquals($form->get('bar[foo][foobar]')->getValue(), 'foobar'); + $this->assertEquals('bar', $form->get('bar[foo][0]')->getValue()); + $this->assertEquals( + 'foobar', + $form->get('bar[foo][foobar]')->getValue() + ); } /** @@ -191,9 +204,9 @@ public function testConstructor($message, $form, $values) $values, array_map( function ($field) { - $class = get_class($field); + $class = \get_class($field); - return array(substr($class, strrpos($class, '\\') + 1), $field->getValue()); + return [substr($class, strrpos($class, '\\') + 1), $field->getValue()]; }, $form->all() ), @@ -203,84 +216,84 @@ function ($field) { public function provideInitializeValues() { - return array( - array( + return [ + [ 'does not take into account input fields without a name attribute', ' ', - array(), - ), - array( + [], + ], + [ 'does not take into account input fields with an empty name attribute value', ' ', - array(), - ), - array( + [], + ], + [ 'takes into account disabled input fields', ' ', - array('foo' => array('InputFormField', 'foo')), - ), - array( + ['foo' => ['InputFormField', 'foo']], + ], + [ 'appends the submitted button value', '', - array('bar' => array('InputFormField', 'bar')), - ), - array( + ['bar' => ['InputFormField', 'bar']], + ], + [ 'appends the submitted button value for Button element', '', - array('bar' => array('InputFormField', 'bar')), - ), - array( + ['bar' => ['InputFormField', 'bar']], + ], + [ 'appends the submitted button value but not other submit buttons', ' ', - array('foobar' => array('InputFormField', 'foobar')), - ), - array( + ['foobar' => ['InputFormField', 'foobar']], + ], + [ 'turns an image input into x and y fields', '', - array('bar.x' => array('InputFormField', '0'), 'bar.y' => array('InputFormField', '0')), - ), - array( + ['bar.x' => ['InputFormField', '0'], 'bar.y' => ['InputFormField', '0']], + ], + [ 'returns textareas', ' ', - array('foo' => array('TextareaFormField', 'foo')), - ), - array( + ['foo' => ['TextareaFormField', 'foo']], + ], + [ 'returns inputs', ' ', - array('foo' => array('InputFormField', 'foo')), - ), - array( + ['foo' => ['InputFormField', 'foo']], + ], + [ 'returns checkboxes', ' ', - array('foo' => array('ChoiceFormField', 'foo')), - ), - array( + ['foo' => ['ChoiceFormField', 'foo']], + ], + [ 'returns not-checked checkboxes', ' ', - array('foo' => array('ChoiceFormField', false)), - ), - array( + ['foo' => ['ChoiceFormField', false]], + ], + [ 'returns radio buttons', ' ', - array('foo' => array('ChoiceFormField', 'bar')), - ), - array( + ['foo' => ['ChoiceFormField', 'bar']], + ], + [ 'returns file inputs', ' ', - array('foo' => array('FileFormField', array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), - ), - ); + ['foo' => ['FileFormField', ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]]], + ], + ]; } public function testGetFormNode() @@ -321,6 +334,12 @@ public function testGetMethod() $this->assertEquals('PATCH', $form->getMethod(), '->getMethod() returns the method defined in the constructor if provided'); } + public function testGetMethodWithOverride() + { + $form = $this->createForm('
    '); + $this->assertEquals('POST', $form->getMethod(), '->getMethod() returns the method attribute value of the form'); + } + public function testGetSetValue() { $form = $this->createForm('
    '); @@ -384,78 +403,86 @@ public function testOffsetExists() public function testGetValues() { $form = $this->createForm('
    '); - $this->assertEquals(array('foo[bar]' => 'foo', 'bar' => 'bar', 'baz' => array()), $form->getValues(), '->getValues() returns all form field values'); + $this->assertEquals(['foo[bar]' => 'foo', 'bar' => 'bar', 'baz' => []], $form->getValues(), '->getValues() returns all form field values'); $form = $this->createForm('
    '); - $this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include not-checked checkboxes'); + $this->assertEquals(['bar' => 'bar'], $form->getValues(), '->getValues() does not include not-checked checkboxes'); $form = $this->createForm('
    '); - $this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include file input fields'); + $this->assertEquals(['bar' => 'bar'], $form->getValues(), '->getValues() does not include file input fields'); $form = $this->createForm('
    '); - $this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include disabled fields'); + $this->assertEquals(['bar' => 'bar'], $form->getValues(), '->getValues() does not include disabled fields'); + + $form = $this->createForm('
    '); + $this->assertEquals(['bar' => 'bar'], $form->getValues(), '->getValues() does not include template fields'); + $this->assertFalse($form->has('foo')); } public function testSetValues() { $form = $this->createForm('
    '); - $form->setValues(array('foo' => false, 'bar' => 'foo')); - $this->assertEquals(array('bar' => 'foo'), $form->getValues(), '->setValues() sets the values of fields'); + $form->setValues(['foo' => false, 'bar' => 'foo']); + $this->assertEquals(['bar' => 'foo'], $form->getValues(), '->setValues() sets the values of fields'); } public function testMultiselectSetValues() { $form = $this->createForm('
    '); - $form->setValues(array('multi' => array('foo', 'bar'))); - $this->assertEquals(array('multi' => array('foo', 'bar')), $form->getValues(), '->setValue() sets the values of select'); + $form->setValues(['multi' => ['foo', 'bar']]); + $this->assertEquals(['multi' => ['foo', 'bar']], $form->getValues(), '->setValue() sets the values of select'); } public function testGetPhpValues() { $form = $this->createForm('
    '); - $this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), '->getPhpValues() converts keys with [] to arrays'); + $this->assertEquals(['foo' => ['bar' => 'foo'], 'bar' => 'bar'], $form->getPhpValues(), '->getPhpValues() converts keys with [] to arrays'); $form = $this->createForm('
    '); - $this->assertEquals(array('fo.o' => array('ba.r' => 'foo'), 'ba r' => 'bar'), $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names'); + $this->assertEquals(['fo.o' => ['ba.r' => 'foo'], 'ba r' => 'bar'], $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names'); $form = $this->createForm('
    '); - $this->assertEquals(array('fo.o' => array('ba.r' => array('foo', 'ba.z' => 'bar'))), $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names recursively'); + $this->assertEquals(['fo.o' => ['ba.r' => ['foo', 'ba.z' => 'bar']]], $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names recursively'); $form = $this->createForm('
    '); - $this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), "->getPhpValues() doesn't return empty values"); + $this->assertEquals(['foo' => ['bar' => 'foo'], 'bar' => 'bar'], $form->getPhpValues(), "->getPhpValues() doesn't return empty values"); } public function testGetFiles() { $form = $this->createForm('
    '); - $this->assertEquals(array(), $form->getFiles(), '->getFiles() returns an empty array if method is get'); + $this->assertEquals([], $form->getFiles(), '->getFiles() returns an empty array if method is get'); $form = $this->createForm('
    '); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for POST'); + $this->assertEquals(['foo[bar]' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]], $form->getFiles(), '->getFiles() only returns file fields for POST'); $form = $this->createForm('
    ', 'put'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for PUT'); + $this->assertEquals(['foo[bar]' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]], $form->getFiles(), '->getFiles() only returns file fields for PUT'); $form = $this->createForm('
    ', 'delete'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for DELETE'); + $this->assertEquals(['foo[bar]' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]], $form->getFiles(), '->getFiles() only returns file fields for DELETE'); $form = $this->createForm('
    ', 'patch'); - $this->assertEquals(array('foo[bar]' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)), $form->getFiles(), '->getFiles() only returns file fields for PATCH'); + $this->assertEquals(['foo[bar]' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]], $form->getFiles(), '->getFiles() only returns file fields for PATCH'); $form = $this->createForm('
    '); - $this->assertEquals(array(), $form->getFiles(), '->getFiles() does not include disabled file fields'); + $this->assertEquals([], $form->getFiles(), '->getFiles() does not include disabled file fields'); + + $form = $this->createForm('
    '); + $this->assertEquals([], $form->getFiles(), '->getFiles() does not include template file fields'); + $this->assertFalse($form->has('foo')); } public function testGetPhpFiles() { $form = $this->createForm('
    '); - $this->assertEquals(array('foo' => array('bar' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), $form->getPhpFiles(), '->getPhpFiles() converts keys with [] to arrays'); + $this->assertEquals(['foo' => ['bar' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]]], $form->getPhpFiles(), '->getPhpFiles() converts keys with [] to arrays'); $form = $this->createForm('
    '); - $this->assertEquals(array('f.o o' => array('bar' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), $form->getPhpFiles(), '->getPhpFiles() preserves periods and spaces in names'); + $this->assertEquals(['f.o o' => ['bar' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]]], $form->getPhpFiles(), '->getPhpFiles() preserves periods and spaces in names'); $form = $this->createForm('
    '); - $this->assertEquals(array('f.o o' => array('bar' => array('ba.z' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0), array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0)))), $form->getPhpFiles(), '->getPhpFiles() preserves periods and spaces in names recursively'); + $this->assertEquals(['f.o o' => ['bar' => ['ba.z' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0], ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]]]], $form->getPhpFiles(), '->getPhpFiles() preserves periods and spaces in names recursively'); $form = $this->createForm('
    '); $files = $form->getPhpFiles(); @@ -464,7 +491,7 @@ public function testGetPhpFiles() $this->assertSame(4, $files['foo']['bar']['error'], '->getPhpFiles() converts error to int'); $form = $this->createForm('
    '); - $this->assertEquals(array('size' => array('error' => array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0))), $form->getPhpFiles(), '->getPhpFiles() int conversion does not collide with file names'); + $this->assertEquals(['size' => ['error' => ['name' => '', 'type' => '', 'tmp_name' => '', 'error' => 4, 'size' => 0]]], $form->getPhpFiles(), '->getPhpFiles() int conversion does not collide with file names'); } /** @@ -537,85 +564,91 @@ public function testGetUriWithoutAction() $this->assertEquals('http://localhost/foo/bar', $form->getUri(), '->getUri() returns path if no action defined'); } + public function testGetUriWithActionOverride() + { + $form = $this->createForm('