diff --git a/admin/module/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php b/admin/module/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php index 4d0292dd119a..2bbdcfe51994 100644 --- a/admin/module/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php +++ b/admin/module/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php @@ -10,43 +10,17 @@ class ExampleMigration extends Migration public function up() { - $fields = [ - 'name' => [ - 'type' => 'varchar', - 'constraint' => 31, - ], - 'uid' => [ - 'type' => 'varchar', - 'constraint' => 31, - ], - 'class' => [ - 'type' => 'varchar', - 'constraint' => 63, - ], - 'icon' => [ - 'type' => 'varchar', - 'constraint' => 31, - ], - 'summary' => [ - 'type' => 'varchar', - 'constraint' => 255, - ], - 'created_at' => [ - 'type' => 'datetime', - 'null' => true, - ], - 'updated_at' => [ - 'type' => 'datetime', - 'null' => true, - ], - 'deleted_at' => [ - 'type' => 'datetime', - 'null' => true, - ], - ]; - $this->forge->addField('id'); - $this->forge->addField($fields); + $this->forge->addField([ + 'name' => ['type' => 'varchar', 'constraint' => 31], + 'uid' => ['type' => 'varchar', 'constraint' => 31], + 'class' => ['type' => 'varchar', 'constraint' => 63], + 'icon' => ['type' => 'varchar', 'constraint' => 31], + 'summary' => ['type' => 'varchar', 'constraint' => 255], + 'created_at' => ['type' => 'datetime', 'null' => true], + 'updated_at' => ['type' => 'datetime', 'null' => true], + 'deleted_at' => ['type' => 'datetime', 'null' => true], + ]); $this->forge->addKey('name'); $this->forge->addKey('uid'); diff --git a/admin/starter/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php b/admin/starter/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php index 4d0292dd119a..2bbdcfe51994 100644 --- a/admin/starter/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php +++ b/admin/starter/tests/_support/Database/Migrations/2020-02-22-222222_example_migration.php @@ -10,43 +10,17 @@ class ExampleMigration extends Migration public function up() { - $fields = [ - 'name' => [ - 'type' => 'varchar', - 'constraint' => 31, - ], - 'uid' => [ - 'type' => 'varchar', - 'constraint' => 31, - ], - 'class' => [ - 'type' => 'varchar', - 'constraint' => 63, - ], - 'icon' => [ - 'type' => 'varchar', - 'constraint' => 31, - ], - 'summary' => [ - 'type' => 'varchar', - 'constraint' => 255, - ], - 'created_at' => [ - 'type' => 'datetime', - 'null' => true, - ], - 'updated_at' => [ - 'type' => 'datetime', - 'null' => true, - ], - 'deleted_at' => [ - 'type' => 'datetime', - 'null' => true, - ], - ]; - $this->forge->addField('id'); - $this->forge->addField($fields); + $this->forge->addField([ + 'name' => ['type' => 'varchar', 'constraint' => 31], + 'uid' => ['type' => 'varchar', 'constraint' => 31], + 'class' => ['type' => 'varchar', 'constraint' => 63], + 'icon' => ['type' => 'varchar', 'constraint' => 31], + 'summary' => ['type' => 'varchar', 'constraint' => 255], + 'created_at' => ['type' => 'datetime', 'null' => true], + 'updated_at' => ['type' => 'datetime', 'null' => true], + 'deleted_at' => ['type' => 'datetime', 'null' => true], + ]); $this->forge->addKey('name'); $this->forge->addKey('uid'); diff --git a/app/Config/Filters.php b/app/Config/Filters.php index 0c5dbd712b73..df90270a6480 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -32,7 +32,7 @@ class Filters extends BaseConfig // 'honeypot', // 'csrf', ], - 'after' => [ + 'after' => [ 'toolbar', // 'honeypot', ], diff --git a/app/Config/Logger.php b/app/Config/Logger.php index 5626006ce96d..397fcc4b5200 100644 --- a/app/Config/Logger.php +++ b/app/Config/Logger.php @@ -88,7 +88,7 @@ class Logger extends BaseConfig /* * The log levels that this handler will handle. */ - 'handles' => [ + 'handles' => [ 'critical', 'alert', 'emergency', @@ -106,7 +106,7 @@ class Logger extends BaseConfig * * Note: Leaving it blank will default to 'log'. */ - 'fileExtension' => '', + 'fileExtension' => '', /* * The file system permissions to be applied on newly created log files. @@ -122,7 +122,7 @@ class Logger extends BaseConfig * By default, logs are written to WRITEPATH . 'logs/' * Specify a different destination here, if desired. */ - 'path' => '', + 'path' => '', ], /** diff --git a/app/Config/Mimes.php b/app/Config/Mimes.php index 339773b4110d..4edcfa4edc5c 100644 --- a/app/Config/Mimes.php +++ b/app/Config/Mimes.php @@ -25,14 +25,14 @@ class Mimes * @var array */ public static $mimes = [ - 'hqx' => [ + 'hqx' => [ 'application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40', ], - 'cpt' => 'application/mac-compactpro', - 'csv' => [ + 'cpt' => 'application/mac-compactpro', + 'csv' => [ 'text/csv', 'text/x-comma-separated-values', 'text/comma-separated-values', @@ -44,17 +44,17 @@ class Mimes 'application/vnd.msexcel', 'text/plain', ], - 'bin' => [ + 'bin' => [ 'application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary', ], - 'dms' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'exe' => [ + 'dms' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'exe' => [ 'application/octet-stream', 'application/x-msdownload', ], @@ -63,25 +63,25 @@ class Mimes 'application/x-photoshop', 'image/vnd.adobe.photoshop', ], - 'so' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => [ + 'so' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => [ 'application/pdf', 'application/force-download', 'application/x-download', ], - 'ai' => [ + 'ai' => [ 'application/pdf', 'application/postscript', ], - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => [ + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => [ 'application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', @@ -95,13 +95,13 @@ class Mimes 'application/vnd.ms-office', 'application/msword', ], - 'ppt' => [ + 'ppt' => [ 'application/vnd.ms-powerpoint', 'application/powerpoint', 'application/vnd.ms-office', 'application/msword', ], - 'pptx' => [ + 'pptx' => [ 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip', @@ -131,10 +131,10 @@ class Mimes 'application/x-javascript', 'text/plain', ], - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => [ + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => [ 'application/x-tar', 'application/x-gzip-compressed', ], @@ -148,42 +148,42 @@ class Mimes 'application/s-compressed', 'multipart/x-zip', ], - 'rar' => [ + 'rar' => [ 'application/vnd.rar', 'application/x-rar', 'application/rar', 'application/x-rar-compressed', ], - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mpga' => 'audio/mpeg', - 'mp2' => 'audio/mpeg', - 'mp3' => [ + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mpga' => 'audio/mpeg', + 'mp2' => 'audio/mpeg', + 'mp3' => [ 'audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3', ], - 'aif' => [ + 'aif' => [ 'audio/x-aiff', 'audio/aiff', ], - 'aiff' => [ + 'aiff' => [ 'audio/x-aiff', 'audio/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' => [ + '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', 'audio/wave', 'audio/wav', ], - 'bmp' => [ + 'bmp' => [ 'image/bmp', 'image/x-bmp', 'image/x-bitmap', @@ -196,82 +196,82 @@ class Mimes 'application/x-bmp', 'application/x-win-bitmap', ], - 'gif' => 'image/gif', - 'jpg' => [ + 'gif' => 'image/gif', + 'jpg' => [ 'image/jpeg', 'image/pjpeg', ], - 'jpeg' => [ + 'jpeg' => [ 'image/jpeg', 'image/pjpeg', ], - 'jpe' => [ + 'jpe' => [ 'image/jpeg', 'image/pjpeg', ], - 'jp2' => [ + 'jp2' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'j2k' => [ + 'j2k' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'jpf' => [ + 'jpf' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'jpg2' => [ + 'jpg2' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'jpx' => [ + 'jpx' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'jpm' => [ + 'jpm' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'mj2' => [ + 'mj2' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'mjp2' => [ + 'mjp2' => [ 'image/jp2', 'video/mj2', 'image/jpx', 'image/jpm', ], - 'png' => [ + 'png' => [ 'image/png', 'image/x-png', ], - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'css' => [ + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'css' => [ 'text/css', 'text/plain', ], - 'html' => [ + 'html' => [ 'text/html', 'text/plain', ], - 'htm' => [ + 'htm' => [ 'text/html', 'text/plain', ], @@ -279,30 +279,30 @@ class Mimes 'text/html', 'text/plain', ], - 'txt' => 'text/plain', - 'text' => 'text/plain', - 'log' => [ + 'txt' => 'text/plain', + 'text' => 'text/plain', + 'log' => [ 'text/plain', 'text/x-log', ], - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'xml' => [ + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'xml' => [ 'application/xml', 'text/xml', 'text/plain', ], - 'xsl' => [ + 'xsl' => [ 'application/xml', 'text/xsl', 'text/xml', ], - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'qt' => 'video/quicktime', - 'mov' => 'video/quicktime', - 'avi' => [ + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + 'avi' => [ 'video/x-msvideo', 'video/msvideo', 'video/avi', @@ -313,131 +313,131 @@ class Mimes 'application/msword', 'application/vnd.ms-office', ], - 'docx' => [ + 'docx' => [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip', ], - 'dot' => [ + 'dot' => [ 'application/msword', 'application/vnd.ms-office', ], - 'dotx' => [ + 'dotx' => [ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', ], - 'xlsx' => [ + 'xlsx' => [ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip', ], - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'word' => [ + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'word' => [ 'application/msword', 'application/octet-stream', ], - 'xl' => 'application/excel', - 'eml' => 'message/rfc822', - 'json' => [ + 'xl' => 'application/excel', + 'eml' => 'message/rfc822', + 'json' => [ 'application/json', 'text/json', ], - 'pem' => [ + 'pem' => [ 'application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream', ], - 'p10' => [ + 'p10' => [ 'application/x-pkcs10', 'application/pkcs10', ], - 'p12' => 'application/x-pkcs12', - 'p7a' => 'application/x-pkcs7-signature', - 'p7c' => [ + 'p12' => 'application/x-pkcs12', + 'p7a' => 'application/x-pkcs7-signature', + 'p7c' => [ 'application/pkcs7-mime', 'application/x-pkcs7-mime', ], - 'p7m' => [ + 'p7m' => [ 'application/pkcs7-mime', 'application/x-pkcs7-mime', ], - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'crt' => [ + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'crt' => [ 'application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert', ], - 'crl' => [ + 'crl' => [ 'application/pkix-crl', 'application/pkcs-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' => [ + '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', 'application/x-x509-ca-cert', ], - '3g2' => 'video/3gpp2', - '3gp' => [ + '3g2' => 'video/3gpp2', + '3gp' => [ 'video/3gp', 'video/3gpp', ], - 'mp4' => 'video/mp4', - 'm4a' => 'audio/x-m4a', - 'f4v' => [ + 'mp4' => 'video/mp4', + 'm4a' => 'audio/x-m4a', + 'f4v' => [ 'video/mp4', 'video/x-f4v', ], - 'flv' => 'video/x-flv', - 'webm' => 'video/webm', - 'aac' => 'audio/x-acc', - 'm4u' => 'application/vnd.mpegurl', - 'm3u' => 'text/plain', - 'xspf' => 'application/xspf+xml', - 'vlc' => 'application/videolan', - 'wmv' => [ + 'flv' => 'video/x-flv', + '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', 'video/x-ms-asf', ], - 'au' => 'audio/x-au', - 'ac3' => 'audio/ac3', - 'flac' => 'audio/x-flac', - 'ogg' => [ + 'au' => 'audio/x-au', + 'ac3' => 'audio/ac3', + 'flac' => 'audio/x-flac', + 'ogg' => [ 'audio/ogg', 'video/ogg', 'application/ogg', ], - 'kmz' => [ + 'kmz' => [ 'application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip', ], - 'kml' => [ + 'kml' => [ 'application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml', ], - 'ics' => 'text/calendar', - 'ical' => 'text/calendar', - 'zsh' => 'text/x-scriptzsh', - '7zip' => [ + 'ics' => 'text/calendar', + 'ical' => 'text/calendar', + 'zsh' => 'text/x-scriptzsh', + '7zip' => [ 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip', ], - 'cdr' => [ + 'cdr' => [ 'application/cdr', 'application/coreldraw', 'application/x-cdr', @@ -446,37 +446,37 @@ class Mimes 'image/x-cdr', 'zz-application/zz-winassoc-cdr', ], - 'wma' => [ + 'wma' => [ 'audio/x-ms-wma', 'video/x-ms-asf', ], - 'jar' => [ + 'jar' => [ 'application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed', ], - 'svg' => [ + 'svg' => [ 'image/svg+xml', 'image/svg', 'application/xml', 'text/xml', ], - 'vcf' => 'text/x-vcard', - 'srt' => [ + 'vcf' => 'text/x-vcard', + 'srt' => [ 'text/srt', 'text/plain', ], - 'vtt' => [ + 'vtt' => [ 'text/vtt', 'text/plain', ], - 'ico' => [ + 'ico' => [ 'image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon', ], - 'stl' => [ + 'stl' => [ 'application/sla', 'application/vnd.ms-pki.stl', 'application/x-navistyle', diff --git a/app/Config/UserAgents.php b/app/Config/UserAgents.php index 5eea09fe5567..e1dbfa63d726 100644 --- a/app/Config/UserAgents.php +++ b/app/Config/UserAgents.php @@ -79,11 +79,11 @@ class UserAgents extends BaseConfig * @var array */ public $browsers = [ - 'OPR' => 'Opera', - 'Flock' => 'Flock', - 'Edge' => 'Spartan', - 'Edg' => 'Edge', - 'Chrome' => 'Chrome', + 'OPR' => 'Opera', + 'Flock' => 'Flock', + 'Edge' => 'Spartan', + 'Edg' => 'Edge', + 'Chrome' => 'Chrome', // Opera 10+ always reports Opera/9.80 and appends Version/ to the user agent string 'Opera.*?Version' => 'Opera', 'Opera' => 'Opera', @@ -121,16 +121,16 @@ class UserAgents extends BaseConfig */ public $mobiles = [ // legacy array, old values commented out - 'mobileexplorer' => 'Mobile Explorer', + 'mobileexplorer' => 'Mobile Explorer', // 'openwave' => 'Open Wave', // 'opera mini' => 'Opera Mini', // 'operamini' => 'Opera Mini', // 'elaine' => 'Palm', - 'palmsource' => 'Palm', + 'palmsource' => 'Palm', // 'digital paths' => 'Palm', // 'avantgo' => 'Avantgo', // 'xiino' => 'Xiino', - 'palmscape' => 'Palmscape', + 'palmscape' => 'Palmscape', // 'nokia' => 'Nokia', // 'ericsson' => 'Ericsson', // 'blackberry' => 'BlackBerry', @@ -181,42 +181,42 @@ class UserAgents extends BaseConfig 'openweb' => 'OpenWeb', // Operating Systems - 'android' => 'Android', - 'symbian' => 'Symbian', - 'SymbianOS' => 'SymbianOS', - 'elaine' => 'Palm', - 'series60' => 'Symbian S60', - 'windows ce' => 'Windows CE', + 'android' => 'Android', + 'symbian' => 'Symbian', + 'SymbianOS' => 'SymbianOS', + 'elaine' => 'Palm', + 'series60' => 'Symbian S60', + 'windows ce' => 'Windows CE', // Browsers - 'obigo' => 'Obigo', - 'netfront' => 'Netfront Browser', - 'openwave' => 'Openwave Browser', - 'mobilexplorer' => 'Mobile Explorer', - 'operamini' => 'Opera Mini', - 'opera mini' => 'Opera Mini', - 'opera mobi' => 'Opera Mobile', - 'fennec' => 'Firefox Mobile', + 'obigo' => 'Obigo', + 'netfront' => 'Netfront Browser', + 'openwave' => 'Openwave Browser', + 'mobilexplorer' => 'Mobile Explorer', + 'operamini' => 'Opera Mini', + 'opera mini' => 'Opera Mini', + 'opera mobi' => 'Opera Mobile', + 'fennec' => 'Firefox Mobile', // Other - 'digital paths' => 'Digital Paths', - 'avantgo' => 'AvantGo', - 'xiino' => 'Xiino', - 'novarra' => 'Novarra Transcoder', - 'vodafone' => 'Vodafone', - 'docomo' => 'NTT DoCoMo', - 'o2' => 'O2', + 'digital paths' => 'Digital Paths', + 'avantgo' => 'AvantGo', + 'xiino' => 'Xiino', + 'novarra' => 'Novarra Transcoder', + 'vodafone' => 'Vodafone', + 'docomo' => 'NTT DoCoMo', + 'o2' => 'O2', // Fallback - 'mobile' => 'Generic Mobile', - 'wireless' => 'Generic Mobile', - 'j2me' => 'Generic Mobile', - 'midp' => 'Generic Mobile', - 'cldc' => 'Generic Mobile', - 'up.link' => 'Generic Mobile', - 'up.browser' => 'Generic Mobile', - 'smartphone' => 'Generic Mobile', - 'cellphone' => 'Generic Mobile', + 'mobile' => 'Generic Mobile', + 'wireless' => 'Generic Mobile', + 'j2me' => 'Generic Mobile', + 'midp' => 'Generic Mobile', + 'cldc' => 'Generic Mobile', + 'up.link' => 'Generic Mobile', + 'up.browser' => 'Generic Mobile', + 'smartphone' => 'Generic Mobile', + 'cellphone' => 'Generic Mobile', ]; /** diff --git a/system/Database/MigrationRunner.php b/system/Database/MigrationRunner.php index e42a84cea2aa..aa86cfde10dd 100644 --- a/system/Database/MigrationRunner.php +++ b/system/Database/MigrationRunner.php @@ -918,23 +918,23 @@ public function ensureTable() $forge = Database::forge($this->db); $forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'BIGINT', 'constraint' => 20, 'unsigned' => true, 'auto_increment' => true, ], - 'version' => [ + 'version' => [ 'type' => 'VARCHAR', 'constraint' => 255, 'null' => false, ], - 'class' => [ + 'class' => [ 'type' => 'VARCHAR', 'constraint' => 255, 'null' => false, ], - 'group' => [ + 'group' => [ 'type' => 'VARCHAR', 'constraint' => 255, 'null' => false, @@ -944,12 +944,12 @@ public function ensureTable() 'constraint' => 255, 'null' => false, ], - 'time' => [ + 'time' => [ 'type' => 'INT', 'constraint' => 11, 'null' => false, ], - 'batch' => [ + 'batch' => [ 'type' => 'INT', 'constraint' => 11, 'unsigned' => true, diff --git a/system/Database/MySQLi/Result.php b/system/Database/MySQLi/Result.php index 4dc7e79173a2..65eb6b7f0b80 100644 --- a/system/Database/MySQLi/Result.php +++ b/system/Database/MySQLi/Result.php @@ -59,29 +59,29 @@ public function getFieldNames(): array public function getFieldData(): array { static $dataTypes = [ - MYSQLI_TYPE_DECIMAL => 'decimal', - MYSQLI_TYPE_NEWDECIMAL => 'newdecimal', - MYSQLI_TYPE_FLOAT => 'float', - MYSQLI_TYPE_DOUBLE => 'double', + MYSQLI_TYPE_DECIMAL => 'decimal', + MYSQLI_TYPE_NEWDECIMAL => 'newdecimal', + MYSQLI_TYPE_FLOAT => 'float', + MYSQLI_TYPE_DOUBLE => 'double', - MYSQLI_TYPE_BIT => 'bit', - MYSQLI_TYPE_SHORT => 'short', - MYSQLI_TYPE_LONG => 'long', - MYSQLI_TYPE_LONGLONG => 'longlong', - MYSQLI_TYPE_INT24 => 'int24', + MYSQLI_TYPE_BIT => 'bit', + MYSQLI_TYPE_SHORT => 'short', + MYSQLI_TYPE_LONG => 'long', + MYSQLI_TYPE_LONGLONG => 'longlong', + MYSQLI_TYPE_INT24 => 'int24', - MYSQLI_TYPE_YEAR => 'year', + MYSQLI_TYPE_YEAR => 'year', - MYSQLI_TYPE_TIMESTAMP => 'timestamp', - MYSQLI_TYPE_DATE => 'date', - MYSQLI_TYPE_TIME => 'time', - MYSQLI_TYPE_DATETIME => 'datetime', - MYSQLI_TYPE_NEWDATE => 'newdate', + MYSQLI_TYPE_TIMESTAMP => 'timestamp', + MYSQLI_TYPE_DATE => 'date', + MYSQLI_TYPE_TIME => 'time', + MYSQLI_TYPE_DATETIME => 'datetime', + MYSQLI_TYPE_NEWDATE => 'newdate', - MYSQLI_TYPE_SET => 'set', + MYSQLI_TYPE_SET => 'set', - MYSQLI_TYPE_VAR_STRING => 'var_string', - MYSQLI_TYPE_STRING => 'string', + MYSQLI_TYPE_VAR_STRING => 'var_string', + MYSQLI_TYPE_STRING => 'string', MYSQLI_TYPE_GEOMETRY => 'geometry', MYSQLI_TYPE_TINY_BLOB => 'tiny_blob', diff --git a/system/Database/Postgre/Connection.php b/system/Database/Postgre/Connection.php index 26d92d872017..62076997c8c3 100644 --- a/system/Database/Postgre/Connection.php +++ b/system/Database/Postgre/Connection.php @@ -295,7 +295,7 @@ public function _fieldData(string $table): array $retVal = []; for ($i = 0, $c = count($query); $i < $c; $i ++) { - $retVal[$i] = new stdClass(); + $retVal[$i] = new stdClass(); $retVal[$i]->name = $query[$i]->column_name; $retVal[$i]->type = $query[$i]->data_type; @@ -384,7 +384,7 @@ public function _foreignKeyData(string $table): array $retVal = []; foreach ($query as $row) { - $obj = new stdClass(); + $obj = new stdClass(); $obj->constraint_name = $row->constraint_name; $obj->table_name = $row->table_name; @@ -392,7 +392,7 @@ public function _foreignKeyData(string $table): array $obj->foreign_table_name = $row->foreign_table_name; $obj->foreign_column_name = $row->foreign_column_name; - $retVal[] = $obj; + $retVal[] = $obj; } return $retVal; diff --git a/system/Database/SQLSRV/Connection.php b/system/Database/SQLSRV/Connection.php index 5e4acde01fd2..56b431d022e6 100755 --- a/system/Database/SQLSRV/Connection.php +++ b/system/Database/SQLSRV/Connection.php @@ -310,7 +310,7 @@ public function _foreignKeyData(string $table): array $retVal = []; foreach ($query as $row) { - $obj = new stdClass(); + $obj = new stdClass(); $obj->constraint_name = $row->constraint_name; $obj->table_name = $row->table_name; @@ -318,7 +318,7 @@ public function _foreignKeyData(string $table): array $obj->foreign_table_name = $row->foreign_table_name; $obj->foreign_column_name = $row->foreign_column_name; - $retVal[] = $obj; + $retVal[] = $obj; } return $retVal; @@ -367,11 +367,11 @@ public function _fieldData(string $table): array $retVal = []; for ($i = 0, $c = count($query); $i < $c; $i++) { - $retVal[$i] = new stdClass(); + $retVal[$i] = new stdClass(); - $retVal[$i]->name = $query[$i]->COLUMN_NAME; - $retVal[$i]->type = $query[$i]->DATA_TYPE; - $retVal[$i]->default = $query[$i]->COLUMN_DEFAULT; + $retVal[$i]->name = $query[$i]->COLUMN_NAME; + $retVal[$i]->type = $query[$i]->DATA_TYPE; + $retVal[$i]->default = $query[$i]->COLUMN_DEFAULT; $retVal[$i]->max_length = $query[$i]->CHARACTER_MAXIMUM_LENGTH > 0 ? $query[$i]->CHARACTER_MAXIMUM_LENGTH diff --git a/system/Database/SQLSRV/Result.php b/system/Database/SQLSRV/Result.php index 08409414f30e..d2fed8735e82 100755 --- a/system/Database/SQLSRV/Result.php +++ b/system/Database/SQLSRV/Result.php @@ -56,32 +56,32 @@ public function getFieldNames(): array public function getFieldData(): array { static $dataTypes = [ - SQLSRV_SQLTYPE_BIGINT => 'bigint', - SQLSRV_SQLTYPE_BIT => 'bit', - SQLSRV_SQLTYPE_CHAR => 'char', + SQLSRV_SQLTYPE_BIGINT => 'bigint', + SQLSRV_SQLTYPE_BIT => 'bit', + SQLSRV_SQLTYPE_CHAR => 'char', - SQLSRV_SQLTYPE_DATE => 'date', - SQLSRV_SQLTYPE_DATETIME => 'datetime', - SQLSRV_SQLTYPE_DATETIME2 => 'datetime2', - SQLSRV_SQLTYPE_DATETIMEOFFSET => 'datetimeoffset', + SQLSRV_SQLTYPE_DATE => 'date', + SQLSRV_SQLTYPE_DATETIME => 'datetime', + SQLSRV_SQLTYPE_DATETIME2 => 'datetime2', + SQLSRV_SQLTYPE_DATETIMEOFFSET => 'datetimeoffset', - SQLSRV_SQLTYPE_DECIMAL => 'decimal', - SQLSRV_SQLTYPE_FLOAT => 'float', + SQLSRV_SQLTYPE_DECIMAL => 'decimal', + SQLSRV_SQLTYPE_FLOAT => 'float', - SQLSRV_SQLTYPE_IMAGE => 'image', - SQLSRV_SQLTYPE_INT => 'int', - SQLSRV_SQLTYPE_MONEY => 'money', - SQLSRV_SQLTYPE_NCHAR => 'nchar', - SQLSRV_SQLTYPE_NUMERIC => 'numeric', + SQLSRV_SQLTYPE_IMAGE => 'image', + SQLSRV_SQLTYPE_INT => 'int', + SQLSRV_SQLTYPE_MONEY => 'money', + SQLSRV_SQLTYPE_NCHAR => 'nchar', + SQLSRV_SQLTYPE_NUMERIC => 'numeric', - SQLSRV_SQLTYPE_NVARCHAR => 'nvarchar', - SQLSRV_SQLTYPE_NTEXT => 'ntext', + SQLSRV_SQLTYPE_NVARCHAR => 'nvarchar', + SQLSRV_SQLTYPE_NTEXT => 'ntext', - SQLSRV_SQLTYPE_REAL => 'real', - SQLSRV_SQLTYPE_SMALLDATETIME => 'smalldatetime', - SQLSRV_SQLTYPE_SMALLINT => 'smallint', - SQLSRV_SQLTYPE_SMALLMONEY => 'smallmoney', - SQLSRV_SQLTYPE_TEXT => 'text', + SQLSRV_SQLTYPE_REAL => 'real', + SQLSRV_SQLTYPE_SMALLDATETIME => 'smalldatetime', + SQLSRV_SQLTYPE_SMALLINT => 'smallint', + SQLSRV_SQLTYPE_SMALLMONEY => 'smallmoney', + SQLSRV_SQLTYPE_TEXT => 'text', SQLSRV_SQLTYPE_TIME => 'time', SQLSRV_SQLTYPE_TIMESTAMP => 'timestamp', @@ -96,7 +96,7 @@ public function getFieldData(): array $retVal = []; foreach (sqlsrv_field_metadata($this->resultID) as $i => $field) { - $retVal[$i] = new stdClass(); + $retVal[$i] = new stdClass(); $retVal[$i]->name = $field['Name']; $retVal[$i]->type = $field['Type']; diff --git a/system/Database/SQLite3/Connection.php b/system/Database/SQLite3/Connection.php index 772842b10fbf..1941d2ef2d13 100644 --- a/system/Database/SQLite3/Connection.php +++ b/system/Database/SQLite3/Connection.php @@ -281,7 +281,7 @@ public function _fieldData(string $table): array $retVal = []; for ($i = 0, $c = count($query); $i < $c; $i++) { - $retVal[$i] = new stdClass(); + $retVal[$i] = new stdClass(); $retVal[$i]->name = $query[$i]->name; $retVal[$i]->type = $query[$i]->type; @@ -318,7 +318,7 @@ public function _indexData(string $table): array $retVal = []; foreach ($query as $row) { - $obj = new stdClass(); + $obj = new stdClass(); $obj->name = $row->name; diff --git a/system/Email/Email.php b/system/Email/Email.php index 0a37388eab1d..b5df794b1ee5 100644 --- a/system/Email/Email.php +++ b/system/Email/Email.php @@ -704,9 +704,9 @@ public function attach($file, $disposition = '', $newname = null, $mime = '') 'name' => $namesAttached, 'disposition' => empty($disposition) ? 'attachment' : $disposition, // Can also be 'inline' Not sure if it matters - 'type' => $mime, - 'content' => chunk_split(base64_encode($fileContent)), - 'multipart' => 'mixed', + 'type' => $mime, + 'content' => chunk_split(base64_encode($fileContent)), + 'multipart' => 'mixed', ]; return $this; @@ -1113,7 +1113,7 @@ public function wordWrap($str, $charlim = null) // Trim the word down $temp .= static::substr($line, 0, $charlim - 1); - $line = static::substr($line, $charlim - 1); + $line = static::substr($line, $charlim - 1); } while (static::strlen($line) > $charlim); // If $temp contains data it means we had to split up an over-length @@ -1197,7 +1197,7 @@ protected function buildMessage() if ($this->getProtocol() === 'mail') { $this->headerStr .= $hdr; - $this->finalBody = $this->body; + $this->finalBody = $this->body; } else { $this->finalBody = $hdr . $this->newline . $this->newline . $this->body; } @@ -1261,7 +1261,7 @@ protected function buildMessage() $lastBoundary = null; if ($this->attachmentsHaveMultipart('mixed')) { - $atcBoundary = uniqid('B_ATC_', true); + $atcBoundary = uniqid('B_ATC_', true); $hdr .= 'Content-Type: multipart/mixed; boundary="' . $atcBoundary . '"'; $lastBoundary = $atcBoundary; } @@ -1345,7 +1345,8 @@ protected function appendAttachments(&$body, $boundary, $multipart = null) if (isset($multipart) && $attachment['multipart'] !== $multipart) { continue; } - $name = $attachment['name'][1] ?? basename($attachment['name'][0]); + + $name = $attachment['name'][1] ?? basename($attachment['name'][0]); $body .= '--' . $boundary . $this->newline . 'Content-Type: ' . $attachment['type'] . '; name="' . $name . '"' . $this->newline . 'Content-Disposition: ' . $attachment['disposition'] . ';' . $this->newline @@ -1512,7 +1513,7 @@ protected function prepQuotedPrintable($str) // reset our temp variable, and keep on chuggin' if ((static::strlen($temp) + static::strlen($char)) >= 76) { $output .= $temp . $escape . $this->CRLF; - $temp = ''; + $temp = ''; } // Add the character to our temporary line @@ -1670,7 +1671,7 @@ public function batchBCCSend() if ($i === $float) { $chunk[] = static::substr($set, 1); $float += $this->BCCBatchSize; - $set = ''; + $set = ''; } if ($i === $c - 1) { diff --git a/system/Encryption/Encryption.php b/system/Encryption/Encryption.php index 410b92bf0dc1..2fec6306e2e8 100644 --- a/system/Encryption/Encryption.php +++ b/system/Encryption/Encryption.php @@ -96,7 +96,7 @@ public function __construct(EncryptionConfig $config = null) $this->handlers = [ 'OpenSSL' => extension_loaded('openssl'), // the SodiumHandler uses some API (like sodium_pad) that is available only on v1.0.14+ - 'Sodium' => extension_loaded('sodium') && version_compare(SODIUM_LIBRARY_VERSION, '1.0.14', '>='), + 'Sodium' => extension_loaded('sodium') && version_compare(SODIUM_LIBRARY_VERSION, '1.0.14', '>='), ]; // If requested driver is not active, bail diff --git a/system/Filters/Filters.php b/system/Filters/Filters.php index bf3ffedac4ef..c6bb1a51cd59 100644 --- a/system/Filters/Filters.php +++ b/system/Filters/Filters.php @@ -268,8 +268,10 @@ public function initialize(string $uri = null) public function reset(): self { $this->initialized = false; - $this->arguments = $this->argumentsClass = []; - $this->filters = $this->filtersClass = [ + + $this->arguments = $this->argumentsClass = []; + + $this->filters = $this->filtersClass = [ 'before' => [], 'after' => [], ]; diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index 9284916a3665..3f7b9336bdcd 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -57,7 +57,7 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s $attributes .= ' method="post"'; } if (stripos($attributes, 'accept-charset=') === false) { - $config = config(App::class); + $config = config(App::class); $attributes .= ' accept-charset="' . strtolower($config->charset) . '"'; } diff --git a/system/Helpers/text_helper.php b/system/Helpers/text_helper.php index da096cb52c1c..dcd51d7916a5 100755 --- a/system/Helpers/text_helper.php +++ b/system/Helpers/text_helper.php @@ -126,8 +126,8 @@ function ascii_to_entities(string $str): string if (count($temp) === $count) { $number = ($count === 3) ? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64) : (($temp[0] % 32) * 64) + ($temp[1] % 64); $out .= '&#' . $number . ';'; - $count = 1; - $temp = []; + $count = 1; + $temp = []; } // If this is the last iteration, just output whatever we have elseif ($i === $s) { @@ -442,7 +442,7 @@ function word_wrap(string $str, int $charlim = 76): string } // Trim the word down $temp .= mb_substr($line, 0, $charlim - 1); - $line = mb_substr($line, $charlim - 1); + $line = mb_substr($line, $charlim - 1); } // If $temp contains data it means we had to split up an over-length diff --git a/system/Images/Handlers/ImageMagickHandler.php b/system/Images/Handlers/ImageMagickHandler.php index 89c4c292489b..db668b6b02d9 100644 --- a/system/Images/Handlers/ImageMagickHandler.php +++ b/system/Images/Handlers/ImageMagickHandler.php @@ -236,7 +236,7 @@ protected function process(string $action, int $quality = 100): array $this->config->libraryPath = rtrim($this->config->libraryPath, '/') . '/convert'; } - $cmd = $this->config->libraryPath; + $cmd = $this->config->libraryPath; $cmd .= $action === '-version' ? ' ' . $action : ' -quality ' . $quality . ' ' . $action; $retval = 1; diff --git a/system/Language/en/CLI.php b/system/Language/en/CLI.php index faab90ca7c9b..8fe504b40283 100644 --- a/system/Language/en/CLI.php +++ b/system/Language/en/CLI.php @@ -11,12 +11,12 @@ // CLI language settings return [ - 'altCommandPlural' => 'Did you mean one of these?', - 'altCommandSingular' => 'Did you mean this?', - 'commandNotFound' => 'Command "{0}" not found.', - 'generator' => [ - 'cancelOperation' => 'Operation has been cancelled.', - 'className' => [ + 'altCommandPlural' => 'Did you mean one of these?', + 'altCommandSingular' => 'Did you mean this?', + 'commandNotFound' => 'Command "{0}" not found.', + 'generator' => [ + 'cancelOperation' => 'Operation has been cancelled.', + 'className' => [ 'command' => 'Command class name', 'config' => 'Config class name', 'controller' => 'Controller class name', diff --git a/system/Language/en/HTTP.php b/system/Language/en/HTTP.php index cfdc79f9c211..ec5dad341e05 100644 --- a/system/Language/en/HTTP.php +++ b/system/Language/en/HTTP.php @@ -12,67 +12,67 @@ // HTTP language settings return [ // CurlRequest - 'missingCurl' => 'CURL must be enabled to use the CURLRequest class.', - 'invalidSSLKey' => 'Cannot set SSL Key. {0} is not a valid file.', - 'sslCertNotFound' => 'SSL certificate not found at: {0}', - 'curlError' => '{0} : {1}', + 'missingCurl' => 'CURL must be enabled to use the CURLRequest class.', + 'invalidSSLKey' => 'Cannot set SSL Key. {0} is not a valid file.', + 'sslCertNotFound' => 'SSL certificate not found at: {0}', + 'curlError' => '{0} : {1}', // IncomingRequest - 'invalidNegotiationType' => '{0} is not a valid negotiation type. Must be one of: media, charset, encoding, language.', + 'invalidNegotiationType' => '{0} is not a valid negotiation type. Must be one of: media, charset, encoding, language.', // Message - 'invalidHTTPProtocol' => 'Invalid HTTP Protocol Version. Must be one of: {0}', + 'invalidHTTPProtocol' => 'Invalid HTTP Protocol Version. Must be one of: {0}', // Negotiate 'emptySupportedNegotiations' => 'You must provide an array of supported values to all Negotiations.', // RedirectResponse - 'invalidRoute' => '{0} route cannot be found while reverse-routing.', + 'invalidRoute' => '{0} route cannot be found while reverse-routing.', // DownloadResponse - 'cannotSetBinary' => 'When setting filepath cannot set binary.', - 'cannotSetFilepath' => 'When setting binary cannot set filepath: {0}', - 'notFoundDownloadSource' => 'Not found download body source.', - 'cannotSetCache' => 'It does not support caching for downloading.', - 'cannotSetStatusCode' => 'It does not support change status code for downloading. code: {0}, reason: {1}', + 'cannotSetBinary' => 'When setting filepath cannot set binary.', + 'cannotSetFilepath' => 'When setting binary cannot set filepath: {0}', + 'notFoundDownloadSource' => 'Not found download body source.', + 'cannotSetCache' => 'It does not support caching for downloading.', + 'cannotSetStatusCode' => 'It does not support change status code for downloading. code: {0}, reason: {1}', // Response - 'missingResponseStatus' => 'HTTP Response is missing a status code', - 'invalidStatusCode' => '{0} is not a valid HTTP return status code', - 'unknownStatusCode' => 'Unknown HTTP status code provided with no message: {0}', + 'missingResponseStatus' => 'HTTP Response is missing a status code', + 'invalidStatusCode' => '{0} is not a valid HTTP return status code', + 'unknownStatusCode' => 'Unknown HTTP status code provided with no message: {0}', // URI - 'cannotParseURI' => 'Unable to parse URI: {0}', - 'segmentOutOfRange' => 'Request URI segment is out of range: {0}', - 'invalidPort' => 'Ports must be between 0 and 65535. Given: {0}', - 'malformedQueryString' => 'Query strings may not include URI fragments.', + 'cannotParseURI' => 'Unable to parse URI: {0}', + 'segmentOutOfRange' => 'Request URI segment is out of range: {0}', + 'invalidPort' => 'Ports must be between 0 and 65535. Given: {0}', + 'malformedQueryString' => 'Query strings may not include URI fragments.', // Page Not Found - 'pageNotFound' => 'Page Not Found', - 'emptyController' => 'No Controller specified.', - 'controllerNotFound' => 'Controller or its method is not found: {0}::{1}', - 'methodNotFound' => 'Controller method is not found: {0}', + 'pageNotFound' => 'Page Not Found', + 'emptyController' => 'No Controller specified.', + 'controllerNotFound' => 'Controller or its method is not found: {0}::{1}', + 'methodNotFound' => 'Controller method is not found: {0}', // CSRF // @deprecated use `Security.disallowedAction` - 'disallowedAction' => 'The action you requested is not allowed.', + 'disallowedAction' => 'The action you requested is not allowed.', // Uploaded file moving - 'alreadyMoved' => 'The uploaded file has already been moved.', - 'invalidFile' => 'The original file is not a valid file.', - 'moveFailed' => 'Could not move file {0} to {1} ({2})', + 'alreadyMoved' => 'The uploaded file has already been moved.', + 'invalidFile' => 'The original file is not a valid file.', + 'moveFailed' => 'Could not move file {0} to {1} ({2})', - 'uploadErrOk' => 'The file uploaded with success.', - 'uploadErrIniSize' => 'The file "%s" exceeds your upload_max_filesize ini directive.', - 'uploadErrFormSize' => 'The file "%s" exceeds the upload limit defined in your form.', - 'uploadErrPartial' => 'The file "%s" was only partially uploaded.', - 'uploadErrNoFile' => 'No file was uploaded.', - 'uploadErrCantWrite' => 'The file "%s" could not be written on disk.', - 'uploadErrNoTmpDir' => 'File could not be uploaded: missing temporary directory.', - 'uploadErrExtension' => 'File upload was stopped by a PHP extension.', - 'uploadErrUnknown' => 'The file "%s" was not uploaded due to an unknown error.', + 'uploadErrOk' => 'The file uploaded with success.', + 'uploadErrIniSize' => 'The file "%s" exceeds your upload_max_filesize ini directive.', + 'uploadErrFormSize' => 'The file "%s" exceeds the upload limit defined in your form.', + 'uploadErrPartial' => 'The file "%s" was only partially uploaded.', + 'uploadErrNoFile' => 'No file was uploaded.', + 'uploadErrCantWrite' => 'The file "%s" could not be written on disk.', + 'uploadErrNoTmpDir' => 'File could not be uploaded: missing temporary directory.', + 'uploadErrExtension' => 'File upload was stopped by a PHP extension.', + 'uploadErrUnknown' => 'The file "%s" was not uploaded due to an unknown error.', // SameSite setting // @deprecated - 'invalidSameSiteSetting' => 'The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}', + 'invalidSameSiteSetting' => 'The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}', ]; diff --git a/system/Language/en/Migrations.php b/system/Language/en/Migrations.php index bbf34e53c2cb..faa57a1f989a 100644 --- a/system/Language/en/Migrations.php +++ b/system/Language/en/Migrations.php @@ -12,27 +12,27 @@ // Migration language settings return [ // Migration Runner - 'missingTable' => 'Migrations table must be set.', - 'disabled' => 'Migrations have been loaded but are disabled or setup incorrectly.', - 'notFound' => 'Migration file not found: ', - 'batchNotFound' => 'Target batch not found: ', - 'empty' => 'No Migration files found', - 'gap' => 'There is a gap in the migration sequence near version number: ', - 'classNotFound' => 'The migration class "%s" could not be found.', - 'missingMethod' => 'The migration class is missing an "%s" method.', + 'missingTable' => 'Migrations table must be set.', + 'disabled' => 'Migrations have been loaded but are disabled or setup incorrectly.', + 'notFound' => 'Migration file not found: ', + 'batchNotFound' => 'Target batch not found: ', + 'empty' => 'No Migration files found', + 'gap' => 'There is a gap in the migration sequence near version number: ', + 'classNotFound' => 'The migration class "%s" could not be found.', + 'missingMethod' => 'The migration class is missing an "%s" method.', // Migration Command - 'migHelpLatest' => "\t\tMigrates database to latest available migration.", - 'migHelpCurrent' => "\t\tMigrates database to version set as 'current' in configuration.", - 'migHelpVersion' => "\tMigrates database to version {v}.", - 'migHelpRollback' => "\tRuns all migrations 'down' to version 0.", - 'migHelpRefresh' => "\t\tUninstalls and re-runs all migrations to freshen database.", - 'migHelpSeed' => "\tRuns the seeder named [name].", - 'migCreate' => "\tCreates a new migration named [name]", - 'nameMigration' => 'Name the migration file', - 'migNumberError' => 'Migration number must be three digits, and there must not be any gaps in the sequence.', - 'rollBackConfirm' => 'Are you sure you want to rollback?', - 'refreshConfirm' => 'Are you sure you want to refresh?', + 'migHelpLatest' => "\t\tMigrates database to latest available migration.", + 'migHelpCurrent' => "\t\tMigrates database to version set as 'current' in configuration.", + 'migHelpVersion' => "\tMigrates database to version {v}.", + 'migHelpRollback' => "\tRuns all migrations 'down' to version 0.", + 'migHelpRefresh' => "\t\tUninstalls and re-runs all migrations to freshen database.", + 'migHelpSeed' => "\tRuns the seeder named [name].", + 'migCreate' => "\tCreates a new migration named [name]", + 'nameMigration' => 'Name the migration file', + 'migNumberError' => 'Migration number must be three digits, and there must not be any gaps in the sequence.', + 'rollBackConfirm' => 'Are you sure you want to rollback?', + 'refreshConfirm' => 'Are you sure you want to refresh?', 'latest' => 'Running all new migrations...', 'generalFault' => 'Migration failed!', @@ -48,10 +48,10 @@ 'added' => 'Running: ', // Migrate Status - 'namespace' => 'Namespace', - 'filename' => 'Filename', - 'version' => 'Version', - 'group' => 'Group', - 'on' => 'Migrated On: ', - 'batch' => 'Batch', + 'namespace' => 'Namespace', + 'filename' => 'Filename', + 'version' => 'Version', + 'group' => 'Group', + 'on' => 'Migrated On: ', + 'batch' => 'Batch', ]; diff --git a/system/Language/en/Number.php b/system/Language/en/Number.php index 22d4363ce299..d9e77586c0a4 100644 --- a/system/Language/en/Number.php +++ b/system/Language/en/Number.php @@ -18,9 +18,9 @@ 'bytes' => 'Bytes', // don't forget the space in front of these! - 'thousand' => ' thousand', - 'million' => ' million', - 'billion' => ' billion', - 'trillion' => ' trillion', - 'quadrillion' => ' quadrillion', + 'thousand' => ' thousand', + 'million' => ' million', + 'billion' => ' billion', + 'trillion' => ' trillion', + 'quadrillion' => ' quadrillion', ]; diff --git a/system/Language/en/Security.php b/system/Language/en/Security.php index f558bea5103d..fdcdf3865cd9 100644 --- a/system/Language/en/Security.php +++ b/system/Language/en/Security.php @@ -14,5 +14,5 @@ 'disallowedAction' => 'The action you requested is not allowed.', // @deprecated - 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}', + 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}', ]; diff --git a/system/Language/en/Validation.php b/system/Language/en/Validation.php index e2d6a4eda065..f57ece4a55ea 100644 --- a/system/Language/en/Validation.php +++ b/system/Language/en/Validation.php @@ -12,11 +12,11 @@ // Validation language settings return [ // Core Messages - 'noRuleSets' => 'No rulesets specified in Validation configuration.', - 'ruleNotFound' => '{0} is not a valid rule.', - 'groupNotFound' => '{0} is not a validation rules group.', - 'groupNotArray' => '{0} rule group must be an array.', - 'invalidTemplate' => '{0} is not a valid Validation template.', + 'noRuleSets' => 'No rulesets specified in Validation configuration.', + 'ruleNotFound' => '{0} is not a valid rule.', + 'groupNotFound' => '{0} is not a validation rules group.', + 'groupNotArray' => '{0} rule group must be an array.', + 'invalidTemplate' => '{0} is not a valid Validation template.', // Rule Messages 'alpha' => 'The {field} field may only contain alphabetical characters.', @@ -60,13 +60,13 @@ 'valid_date' => 'The {field} field must contain a valid date.', // Credit Cards - 'valid_cc_num' => '{field} does not appear to be a valid credit card number.', + 'valid_cc_num' => '{field} does not appear to be a valid credit card number.', // Files - 'uploaded' => '{field} is not a valid uploaded file.', - 'max_size' => '{field} is too large of a file.', - 'is_image' => '{field} is not a valid, uploaded image file.', - 'mime_in' => '{field} does not have a valid mime type.', - 'ext_in' => '{field} does not have a valid file extension.', - 'max_dims' => '{field} is either not an image, or it is too wide or tall.', + 'uploaded' => '{field} is not a valid uploaded file.', + 'max_size' => '{field} is too large of a file.', + 'is_image' => '{field} is not a valid, uploaded image file.', + 'mime_in' => '{field} does not have a valid mime type.', + 'ext_in' => '{field} does not have a valid file extension.', + 'max_dims' => '{field} is either not an image, or it is too wide or tall.', ]; diff --git a/system/Log/Handlers/ChromeLoggerHandler.php b/system/Log/Handlers/ChromeLoggerHandler.php index 3765fa3c8d06..a1f915acdad4 100644 --- a/system/Log/Handlers/ChromeLoggerHandler.php +++ b/system/Log/Handlers/ChromeLoggerHandler.php @@ -48,7 +48,7 @@ class ChromeLoggerHandler extends BaseHandler 'backtrace', 'type', ], - 'rows' => [], + 'rows' => [], ]; /** diff --git a/system/Test/Mock/MockLogger.php b/system/Test/Mock/MockLogger.php index 98cb94af7b9b..3427fe7ec251 100644 --- a/system/Test/Mock/MockLogger.php +++ b/system/Test/Mock/MockLogger.php @@ -102,7 +102,7 @@ class MockLogger /* * Logging Directory Path */ - 'path' => '', + 'path' => '', ], ]; } diff --git a/system/Throttle/Throttler.php b/system/Throttle/Throttler.php index bd6f8dd1672c..5310edb9e728 100644 --- a/system/Throttle/Throttler.php +++ b/system/Throttle/Throttler.php @@ -135,7 +135,7 @@ public function check(string $key, int $capacity, int $seconds, int $cost = 1): // should be refilled, then checked against capacity // to be sure the bucket didn't overflow. $tokens += $rate * $elapsed; - $tokens = $tokens > $capacity ? $capacity : $tokens; + $tokens = $tokens > $capacity ? $capacity : $tokens; // If $tokens >= 1, then we are safe to perform the action, but // we need to decrement the number of available tokens. diff --git a/system/Typography/Typography.php b/system/Typography/Typography.php index 89d8b2251f14..38da93779ba9 100644 --- a/system/Typography/Typography.php +++ b/system/Typography/Typography.php @@ -186,28 +186,28 @@ public function autoTypography(string $str, bool $reduceLinebreaks = false): str $table = [ // If the user submitted their own paragraph tags within the text // we will retain them instead of using our tags. - '/(*?]>)

/' => '$1', // *?]>)

/' => '$1', // )+#' => '

', - '/(

\W*

)+/' => '

', + '#(

)+#' => '

', + '/(

\W*

)+/' => '

', // Clean up stray paragraph tags that appear before block level elements - '#

<(' . $this->blockElements . ')#' => '<$1', + '#

<(' . $this->blockElements . ')#' => '<$1', // Clean up stray non-breaking spaces preceeding block elements '#( \s*)+<(' . $this->blockElements . ')#' => ' <$2', // Replace the temporary markers we added earlier - '/\{@TAG\}/' => '<', - '/\{@DQ\}/' => '"', - '/\{@SQ\}/' => "'", - '/\{@DD\}/' => '--', - '/\{@NBS\}/' => ' ', + '/\{@TAG\}/' => '<', + '/\{@DQ\}/' => '"', + '/\{@SQ\}/' => "'", + '/\{@DD\}/' => '--', + '/\{@NBS\}/' => ' ', // An unintended consequence of the _format_newlines function is that // some of the newlines get truncated, resulting in

tags // starting immediately after tags on the same line. // This forces a newline after such occurrences, which looks much nicer. - "/>

\n/" => ">\n

", + "/>

\n/" => ">\n

", // Similarly, there might be cases where a closing will follow // a closing

tag, so we'll correct it by adding a newline in between - '#

"

\n "

\n '’”$1', - '/(^|\s|

)\'"/' => '$1‘“', - '/\'"(\W)/' => '’”$1', - '/(\W)\'"/' => '$1‘“', - '/"\'(\s|$)/' => '”’$1', - '/(^|\s|

)"\'/' => '$1“‘', - '/"\'(\W)/' => '”’$1', - '/(\W)"\'/' => '$1“‘', + '/\'"(\s|$)/' => '’”$1', + '/(^|\s|

)\'"/' => '$1‘“', + '/\'"(\W)/' => '’”$1', + '/(\W)\'"/' => '$1‘“', + '/"\'(\s|$)/' => '”’$1', + '/(^|\s|

)"\'/' => '$1“‘', + '/"\'(\W)/' => '”’$1', + '/(\W)"\'/' => '$1“‘', // single quote smart quotes - '/\'(\s|$)/' => '’$1', - '/(^|\s|

)\'/' => '$1‘', - '/\'(\W)/' => '’$1', - '/(\W)\'/' => '$1‘', + '/\'(\s|$)/' => '’$1', + '/(^|\s|

)\'/' => '$1‘', + '/\'(\W)/' => '’$1', + '/(\W)\'/' => '$1‘', // double quote smart quotes - '/"(\s|$)/' => '”$1', - '/(^|\s|

)"/' => '$1“', - '/"(\W)/' => '”$1', - '/(\W)"/' => '$1“', + '/"(\s|$)/' => '”$1', + '/(^|\s|

)"/' => '$1“', + '/"(\W)/' => '”$1', + '/(\W)"/' => '$1“', // apostrophes - "/(\w)'(\w)/" => '$1’$2', + "/(\w)'(\w)/" => '$1’$2', // Em dash and ellipses dots - '/\s?\-\-\s?/' => '—', - '/(\w)\.{3}/' => '$1…', + '/\s?\-\-\s?/' => '—', + '/(\w)\.{3}/' => '$1…', // double space after sentences - '/(\W) /' => '$1  ', + '/(\W) /' => '$1  ', // ampersands, if not a character entity '/&(?!#?[a-zA-Z0-9]{2,};)/' => '&', ]; diff --git a/system/Validation/CreditCardRules.php b/system/Validation/CreditCardRules.php index 4a3fc4b082bc..f4be76d4a993 100644 --- a/system/Validation/CreditCardRules.php +++ b/system/Validation/CreditCardRules.php @@ -31,110 +31,110 @@ class CreditCardRules * @var array */ protected $cards = [ - 'American Express' => [ + 'American Express' => [ 'name' => 'amex', 'length' => '15', 'prefixes' => '34,37', 'checkdigit' => true, ], - 'China UnionPay' => [ + 'China UnionPay' => [ 'name' => 'unionpay', 'length' => '16,17,18,19', 'prefixes' => '62', 'checkdigit' => true, ], - 'Dankort' => [ + 'Dankort' => [ 'name' => 'dankort', 'length' => '16', 'prefixes' => '5019,4175,4571,4', 'checkdigit' => true, ], - 'DinersClub' => [ + 'DinersClub' => [ 'name' => 'dinersclub', 'length' => '14,16', 'prefixes' => '300,301,302,303,304,305,309,36,38,39,54,55', 'checkdigit' => true, ], - 'DinersClub CarteBlanche' => [ + 'DinersClub CarteBlanche' => [ 'name' => 'carteblanche', 'length' => '14', 'prefixes' => '300,301,302,303,304,305', 'checkdigit' => true, ], - 'Discover Card' => [ + 'Discover Card' => [ 'name' => 'discover', 'length' => '16,19', 'prefixes' => '6011,622,644,645,656,647,648,649,65', 'checkdigit' => true, ], - 'InterPayment' => [ + 'InterPayment' => [ 'name' => 'interpayment', 'length' => '16,17,18,19', 'prefixes' => '4', 'checkdigit' => true, ], - 'JCB' => [ + 'JCB' => [ 'name' => 'jcb', 'length' => '16,17,18,19', 'prefixes' => '352,353,354,355,356,357,358', 'checkdigit' => true, ], - 'Maestro' => [ + 'Maestro' => [ 'name' => 'maestro', 'length' => '12,13,14,15,16,18,19', 'prefixes' => '50,56,57,58,59,60,61,62,63,64,65,66,67,68,69', 'checkdigit' => true, ], - 'MasterCard' => [ + 'MasterCard' => [ 'name' => 'mastercard', 'length' => '16', 'prefixes' => '51,52,53,54,55,22,23,24,25,26,27', 'checkdigit' => true, ], - 'NSPK MIR' => [ + 'NSPK MIR' => [ 'name' => 'mir', 'length' => '16', 'prefixes' => '2200,2201,2202,2203,2204', 'checkdigit' => true, ], - 'Troy' => [ + 'Troy' => [ 'name' => 'troy', 'length' => '16', 'prefixes' => '979200,979289', 'checkdigit' => true, ], - 'UATP' => [ + 'UATP' => [ 'name' => 'uatp', 'length' => '15', 'prefixes' => '1', 'checkdigit' => true, ], - 'Verve' => [ + 'Verve' => [ 'name' => 'verve', 'length' => '16,19', 'prefixes' => '506,650', 'checkdigit' => true, ], - 'Visa' => [ + 'Visa' => [ 'name' => 'visa', 'length' => '13,16,19', 'prefixes' => '4', 'checkdigit' => true, ], // Canadian Cards - 'BMO ABM Card' => [ + 'BMO ABM Card' => [ 'name' => 'bmoabm', 'length' => '16', 'prefixes' => '500', 'checkdigit' => false, ], - 'CIBC Convenience Card' => [ + 'CIBC Convenience Card' => [ 'name' => 'cibc', 'length' => '16', 'prefixes' => '4506', 'checkdigit' => false, ], - 'HSBC Canada Card' => [ + 'HSBC Canada Card' => [ 'name' => 'hsbc', 'length' => '16', 'prefixes' => '56', @@ -146,13 +146,13 @@ class CreditCardRules 'prefixes' => '45', 'checkdigit' => false, ], - 'Scotiabank Scotia Card' => [ + 'Scotiabank Scotia Card' => [ 'name' => 'scotia', 'length' => '16', 'prefixes' => '4536', 'checkdigit' => false, ], - 'TD Canada Trust Access Card' => [ + 'TD Canada Trust Access Card' => [ 'name' => 'tdtrust', 'length' => '16', 'prefixes' => '589297', diff --git a/system/Validation/Rules.php b/system/Validation/Rules.php index d5dd798a00db..c91e109998fa 100644 --- a/system/Validation/Rules.php +++ b/system/Validation/Rules.php @@ -370,8 +370,7 @@ public function required_with($str = null, string $fields = null, array $data = $requiredFields = []; foreach ($fields as $field) { - if ((array_key_exists($field, $data) && ! empty($data[$field])) || - (strpos($field, '.') !== false && ! empty(dot_array_search($field, $data))) ) { + if ((array_key_exists($field, $data) && ! empty($data[$field])) || (strpos($field, '.') !== false && ! empty(dot_array_search($field, $data)))) { $requiredFields[] = $field; } } @@ -415,9 +414,7 @@ public function required_without($str = null, string $fields = null, array $data // Still here? Then we fail this test if // any of the fields are not present in $data foreach ($fields as $field) { - if ((strpos($field, '.') === false && (! array_key_exists($field, $data) || empty($data[$field]))) || - (strpos($field, '.') !== false && empty(dot_array_search($field, $data))) - ) { + if ((strpos($field, '.') === false && (! array_key_exists($field, $data) || empty($data[$field]))) || (strpos($field, '.') !== false && empty(dot_array_search($field, $data)))) { return false; } } diff --git a/tests/_support/Config/Registrar.php b/tests/_support/Config/Registrar.php index 4135079b73e2..32d114b25f3d 100644 --- a/tests/_support/Config/Registrar.php +++ b/tests/_support/Config/Registrar.php @@ -16,7 +16,7 @@ class Registrar * @var array */ protected static $dbConfig = [ - 'MySQLi' => [ + 'MySQLi' => [ 'DSN' => '', 'hostname' => '127.0.0.1', 'username' => 'root', @@ -73,7 +73,7 @@ class Registrar 'failover' => [], 'port' => 3306, ], - 'SQLSRV' => [ + 'SQLSRV' => [ 'DSN' => '', 'hostname' => 'localhost', 'username' => 'sa', diff --git a/tests/_support/Config/TestRegistrar.php b/tests/_support/Config/TestRegistrar.php index c4b79164ecfa..947587d84069 100644 --- a/tests/_support/Config/TestRegistrar.php +++ b/tests/_support/Config/TestRegistrar.php @@ -13,7 +13,7 @@ class TestRegistrar public static function RegistrarConfig() { return [ - 'bar' => [ + 'bar' => [ 'first', 'second', ], diff --git a/tests/_support/Database/Seeds/CITestSeeder.php b/tests/_support/Database/Seeds/CITestSeeder.php index 7653e2d4ee4e..16a9ad1f1cea 100644 --- a/tests/_support/Database/Seeds/CITestSeeder.php +++ b/tests/_support/Database/Seeds/CITestSeeder.php @@ -10,7 +10,7 @@ public function run() { // Job Data $data = [ - 'user' => [ + 'user' => [ [ 'name' => 'Derek Jones', 'email' => 'derek@world.com', @@ -32,7 +32,7 @@ public function run() 'country' => 'UK', ], ], - 'job' => [ + 'job' => [ [ 'name' => 'Developer', 'description' => 'Awesome job, but sometimes makes you bored', @@ -50,7 +50,7 @@ public function run() 'description' => 'Only Coldplay can actually called Musician', ], ], - 'misc' => [ + 'misc' => [ [ 'key' => '\\xxxfoo456', 'value' => 'Entry with \\xxx', @@ -64,7 +64,7 @@ public function run() 'value' => ' One two three tab', ], ], - 'stringifypkey' => [ + 'stringifypkey' => [ [ 'id' => 'A01', 'value' => 'test', @@ -76,7 +76,7 @@ public function run() 'value' => 'value', ], ], - 'type_test' => [ + 'type_test' => [ [ 'type_varchar' => 'test', 'type_char' => 'test', diff --git a/tests/_support/Models/ValidErrorsModel.php b/tests/_support/Models/ValidErrorsModel.php index 4e17fef488ee..97ea3a359a4f 100644 --- a/tests/_support/Models/ValidErrorsModel.php +++ b/tests/_support/Models/ValidErrorsModel.php @@ -20,7 +20,7 @@ class ValidErrorsModel extends Model ]; protected $validationRules = [ - 'name' => [ + 'name' => [ 'required', 'min_length[10]', 'errors' => [ diff --git a/tests/_support/Models/ValidModel.php b/tests/_support/Models/ValidModel.php index de6ae7336bad..4a877802e0e9 100644 --- a/tests/_support/Models/ValidModel.php +++ b/tests/_support/Models/ValidModel.php @@ -20,7 +20,7 @@ class ValidModel extends Model ]; protected $validationRules = [ - 'name' => [ + 'name' => [ 'required', 'min_length[3]', ], diff --git a/tests/system/API/ResponseTraitTest.php b/tests/system/API/ResponseTraitTest.php index 21cf3820a3c3..fd2ff44a27ac 100644 --- a/tests/system/API/ResponseTraitTest.php +++ b/tests/system/API/ResponseTraitTest.php @@ -34,19 +34,19 @@ protected function makeController(array $userConfig = [], string $uri = 'http:// $config = new App(); foreach ([ - 'baseURL' => 'http://example.com/', - 'uriProtocol' => 'REQUEST_URI', - 'defaultLocale' => 'en', - 'negotiateLocale' => false, + 'baseURL' => 'http://example.com/', + 'uriProtocol' => 'REQUEST_URI', + 'defaultLocale' => 'en', + 'negotiateLocale' => false, 'supportedLocales' => ['en'], - 'CSPEnabled' => false, - 'cookiePrefix' => '', - 'cookieDomain' => '', - 'cookiePath' => '/', - 'cookieSecure' => false, - 'cookieHTTPOnly' => false, - 'proxyIPs' => [], - 'cookieSameSite' => 'Lax', + 'CSPEnabled' => false, + 'cookiePrefix' => '', + 'cookieDomain' => '', + 'cookiePath' => '/', + 'cookieSecure' => false, + 'cookieHTTPOnly' => false, + 'proxyIPs' => [], + 'cookieSameSite' => 'Lax', ] as $key => $value) { $config->$key = $value; } @@ -142,7 +142,7 @@ public function testArrayPayload() 2, 3, ]; - $expected = << 'http://example.com/', - 'uriProtocol' => 'REQUEST_URI', - 'defaultLocale' => 'en', - 'negotiateLocale' => false, + 'baseURL' => 'http://example.com/', + 'uriProtocol' => 'REQUEST_URI', + 'defaultLocale' => 'en', + 'negotiateLocale' => false, 'supportedLocales' => ['en'], - 'CSPEnabled' => false, - 'cookiePrefix' => '', - 'cookieDomain' => '', - 'cookiePath' => '/', - 'cookieSecure' => false, - 'cookieHTTPOnly' => false, - 'proxyIPs' => [], - 'cookieSameSite' => 'Lax', + 'CSPEnabled' => false, + 'cookiePrefix' => '', + 'cookieDomain' => '', + 'cookiePath' => '/', + 'cookieSecure' => false, + 'cookieHTTPOnly' => false, + 'proxyIPs' => [], + 'cookieSameSite' => 'Lax', ] as $key => $value) { $config->$key = $value; } diff --git a/tests/system/Autoloader/AutoloaderTest.php b/tests/system/Autoloader/AutoloaderTest.php index 7021d0c62d4e..0655f74930f5 100644 --- a/tests/system/Autoloader/AutoloaderTest.php +++ b/tests/system/Autoloader/AutoloaderTest.php @@ -30,7 +30,7 @@ protected function setUp(): void 'OtherClass' => APPPATH . 'Controllers/Home.php', 'Name\Spaced\Class' => APPPATH . 'Controllers/Home.php', ]; - $config->psr4 = [ + $config->psr4 = [ 'App' => APPPATH, 'CodeIgniter' => SYSTEMPATH, ]; diff --git a/tests/system/Autoloader/FileLocatorTest.php b/tests/system/Autoloader/FileLocatorTest.php index bea7d4ed80be..872c43c82481 100644 --- a/tests/system/Autoloader/FileLocatorTest.php +++ b/tests/system/Autoloader/FileLocatorTest.php @@ -29,8 +29,8 @@ protected function setUp(): void TESTPATH, SYSTEMPATH, ], - 'Errors' => APPPATH . 'Views/errors', - 'System' => SUPPORTPATH . 'Autoloader/system', + 'Errors' => APPPATH . 'Views/errors', + 'System' => SUPPORTPATH . 'Autoloader/system', ]); $this->locator = new FileLocator($autoloader); diff --git a/tests/system/CLI/CLITest.php b/tests/system/CLI/CLITest.php index bd63fa840696..f5f621f237ed 100644 --- a/tests/system/CLI/CLITest.php +++ b/tests/system/CLI/CLITest.php @@ -382,11 +382,11 @@ public function testTable($tbody, $thead, $expected) public function tableProvider() { - $head = [ + $head = [ 'ID', 'Title', ]; - $oneRow = [ + $oneRow = [ [ 'id' => 1, 'foo' => 'bar', diff --git a/tests/system/Cache/CacheFactoryTest.php b/tests/system/Cache/CacheFactoryTest.php index 06bdaf9e41c1..3fd362e1e26b 100644 --- a/tests/system/Cache/CacheFactoryTest.php +++ b/tests/system/Cache/CacheFactoryTest.php @@ -19,7 +19,7 @@ protected function setUp(): void $this->cacheFactory = new CacheFactory(); //Initialize path - $this->config = new Cache(); + $this->config = new Cache(); $this->config->storePath .= self::$directory; } @@ -87,7 +87,7 @@ public function testGetDummyHandler() $this->assertInstanceOf(DummyHandler::class, $this->cacheFactory->getHandler($this->config)); //Initialize path - $this->config = new Cache(); + $this->config = new Cache(); $this->config->storePath .= self::$directory; } @@ -106,7 +106,7 @@ public function testHandlesBadHandler() } //Initialize path - $this->config = new Cache(); + $this->config = new Cache(); $this->config->storePath .= self::$directory; } } diff --git a/tests/system/Cache/Handlers/FileHandlerTest.php b/tests/system/Cache/Handlers/FileHandlerTest.php index ef832c94b2f9..bb998f930295 100644 --- a/tests/system/Cache/Handlers/FileHandlerTest.php +++ b/tests/system/Cache/Handlers/FileHandlerTest.php @@ -35,7 +35,7 @@ protected function setUp(): void } // Initialize path - $this->config = new Cache(); + $this->config = new Cache(); $this->config->file['storePath'] .= self::$directory; if (! is_dir($this->config->file['storePath'])) { @@ -322,7 +322,7 @@ final class BaseTestFileHandler extends FileHandler public function __construct() { - $this->config = new Cache(); + $this->config = new Cache(); $this->config->file['storePath'] .= self::$directory; parent::__construct($this->config); diff --git a/tests/system/CodeIgniterTest.php b/tests/system/CodeIgniterTest.php index b13705cd1d5b..d67be6d671dd 100644 --- a/tests/system/CodeIgniterTest.php +++ b/tests/system/CodeIgniterTest.php @@ -64,11 +64,12 @@ public function testRunEmptyDefaultRoute() public function testRunClosureRoute() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'pages/about', ]; - $_SERVER['argc'] = 2; + $_SERVER['argc'] = 2; + $_SERVER['REQUEST_URI'] = '/pages/about'; // Inject mock router. @@ -140,7 +141,7 @@ public function testRun404OverrideByClosure() public function testControllersCanReturnString() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'pages/about', ]; @@ -166,7 +167,7 @@ public function testControllersCanReturnString() public function testControllersCanReturnResponseObject() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'pages/about', ]; @@ -177,7 +178,7 @@ public function testControllersCanReturnResponseObject() $routes = Services::routes(); $routes->add('pages/(:segment)', static function ($segment) { $response = Services::response(); - $string = "You want to see 'about' page."; + $string = "You want to see 'about' page."; return $response->setBody($string); }); @@ -229,7 +230,7 @@ public function testRoutesIsEmpty() public function testTransfersCorrectHTTPVersion() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', '/', ]; @@ -290,7 +291,7 @@ public function testRunForceSecure() public function testRunRedirectionWithNamed() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'example', ]; @@ -315,7 +316,7 @@ public function testRunRedirectionWithNamed() public function testRunRedirectionWithURI() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'example', ]; @@ -343,7 +344,7 @@ public function testRunRedirectionWithURI() */ public function testRunRedirectionWithURINotSet() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'example', ]; @@ -366,7 +367,7 @@ public function testRunRedirectionWithURINotSet() public function testRunRedirectionWithHTTPCode303() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'example', ]; @@ -391,7 +392,7 @@ public function testRunRedirectionWithHTTPCode303() public function testRunRedirectionWithHTTPCode301() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'example', ]; diff --git a/tests/system/Commands/ConfigurableSortImportsTest.php b/tests/system/Commands/ConfigurableSortImportsTest.php index 6be9330e25bd..cd0c72c14bdf 100644 --- a/tests/system/Commands/ConfigurableSortImportsTest.php +++ b/tests/system/Commands/ConfigurableSortImportsTest.php @@ -44,7 +44,7 @@ public function testEnabledSortImportsWillDisruptLanguageFilePublish() $this->assertFileExists($file); $this->assertNotSame(sha1_file(SUPPORTPATH . 'Commands/Foobar.php'), sha1_file($file)); is_file($file) && unlink($file); - $dir = dirname($file); + $dir = dirname($file); is_dir($dir) && rmdir($dir); } @@ -57,7 +57,7 @@ public function testDisabledSortImportsWillNotAffectLanguageFilesPublish() $this->assertFileExists($file); $this->assertSame(sha1_file(SUPPORTPATH . 'Commands/Foobar.php'), sha1_file($file)); is_file($file) && unlink($file); - $dir = dirname($file); + $dir = dirname($file); is_dir($dir) && rmdir($dir); } } diff --git a/tests/system/CommonFunctionsTest.php b/tests/system/CommonFunctionsTest.php index ea6502ba397f..2256d5210f49 100644 --- a/tests/system/CommonFunctionsTest.php +++ b/tests/system/CommonFunctionsTest.php @@ -122,7 +122,7 @@ public function testRedirectDefault() public function testView() { - $data = [ + $data = [ 'testString' => 'bar', 'bar' => 'baz', ]; @@ -132,7 +132,7 @@ public function testView() public function testViewSavedData() { - $data = [ + $data = [ 'testString' => 'bar', 'bar' => 'baz', ]; diff --git a/tests/system/Config/BaseConfigTest.php b/tests/system/Config/BaseConfigTest.php index 67b0ba9569a0..72af3ab9f6a1 100644 --- a/tests/system/Config/BaseConfigTest.php +++ b/tests/system/Config/BaseConfigTest.php @@ -53,7 +53,7 @@ public function testServerValues() 'simpleconfig.shortie' => 123, 'SimpleConfig.longie' => 456, ]; - $dotenv = new DotEnv($this->fixturesFolder, '.env'); + $dotenv = new DotEnv($this->fixturesFolder, '.env'); $dotenv->load(); $config = new SimpleConfig(); diff --git a/tests/system/Config/MimesTest.php b/tests/system/Config/MimesTest.php index a89e24f39d33..067b0f535c97 100644 --- a/tests/system/Config/MimesTest.php +++ b/tests/system/Config/MimesTest.php @@ -10,15 +10,15 @@ class MimesTest extends CIUnitTestCase public function extensionsList() { return [ - 'null' => [ + 'null' => [ null, 'xkadjflkjdsf', ], - 'single' => [ + 'single' => [ 'cpt', 'application/mac-compactpro', ], - 'trimmed' => [ + 'trimmed' => [ 'cpt', ' application/mac-compactpro ', ], @@ -51,19 +51,19 @@ public function testGuessExtensionFromType($expected, $mime) public function mimesList() { return [ - 'null' => [ + 'null' => [ null, 'xalkjdlfkj', ], - 'single' => [ + 'single' => [ 'audio/midi', 'mid', ], - 'many' => [ + 'many' => [ 'image/bmp', 'bmp', ], - 'trimmed' => [ + 'trimmed' => [ 'image/bmp', '.bmp', ], diff --git a/tests/system/Config/fixtures/SimpleConfig.php b/tests/system/Config/fixtures/SimpleConfig.php index 5a4f25d1db0c..d6fe4ac38416 100644 --- a/tests/system/Config/fixtures/SimpleConfig.php +++ b/tests/system/Config/fixtures/SimpleConfig.php @@ -13,7 +13,7 @@ class SimpleConfig extends \CodeIgniter\Config\BaseConfig public $default = [ 'name' => null, ]; - public $simple = [ + public $simple = [ 'name' => null, ]; // properties for environment over-ride testing diff --git a/tests/system/ControllerTest.php b/tests/system/ControllerTest.php index d3eb1856be2a..37e9596f58c8 100644 --- a/tests/system/ControllerTest.php +++ b/tests/system/ControllerTest.php @@ -123,8 +123,8 @@ public function testValidateWithStringRulesNotFound() public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig() { - $validation = config('Validation'); - $validation->signup = [ + $validation = config('Validation'); + $validation->signup = [ 'username' => 'required', ]; $validation->signup_errors = [ diff --git a/tests/system/Database/BaseQueryTest.php b/tests/system/Database/BaseQueryTest.php index bc4aad71b71d..8b926cc83530 100644 --- a/tests/system/Database/BaseQueryTest.php +++ b/tests/system/Database/BaseQueryTest.php @@ -93,35 +93,35 @@ public function testSwapPrefix() public function queryTypes() { return [ - 'select' => [ + 'select' => [ false, 'SELECT * FROM users', ], - 'set' => [ + 'set' => [ true, 'SET ...', ], - 'insert' => [ + 'insert' => [ true, 'INSERT INTO ...', ], - 'update' => [ + 'update' => [ true, 'UPDATE ...', ], - 'delete' => [ + 'delete' => [ true, 'DELETE ...', ], - 'replace' => [ + 'replace' => [ true, 'REPLACE ...', ], - 'create' => [ + 'create' => [ true, 'CREATE ...', ], - 'drop' => [ + 'drop' => [ true, 'DROP ...', ], @@ -129,39 +129,39 @@ public function queryTypes() true, 'TRUNCATE ...', ], - 'load' => [ + 'load' => [ true, 'LOAD ...', ], - 'copy' => [ + 'copy' => [ true, 'COPY ...', ], - 'alter' => [ + 'alter' => [ true, 'ALTER ...', ], - 'rename' => [ + 'rename' => [ true, 'RENAME ...', ], - 'grant' => [ + 'grant' => [ true, 'GRANT ...', ], - 'revoke' => [ + 'revoke' => [ true, 'REVOKE ...', ], - 'lock' => [ + 'lock' => [ true, 'LOCK ...', ], - 'unlock' => [ + 'unlock' => [ true, 'UNLOCK ...', ], - 'reindex' => [ + 'reindex' => [ true, 'REINDEX ...', ], diff --git a/tests/system/Database/Builder/InsertTest.php b/tests/system/Database/Builder/InsertTest.php index 1a0ccc3dc37f..f732fafda04e 100644 --- a/tests/system/Database/Builder/InsertTest.php +++ b/tests/system/Database/Builder/InsertTest.php @@ -30,7 +30,7 @@ public function testSimpleInsert() $expectedSQL = 'INSERT INTO "jobs" ("id", "name") VALUES (1, \'Grocery Sales\')'; $expectedBinds = [ - 'id' => [ + 'id' => [ 1, true, ], diff --git a/tests/system/Database/Builder/LikeTest.php b/tests/system/Database/Builder/LikeTest.php index 29c84d709494..de09d48fa60f 100644 --- a/tests/system/Database/Builder/LikeTest.php +++ b/tests/system/Database/Builder/LikeTest.php @@ -97,7 +97,7 @@ public function testOrLike() $expectedSQL = "SELECT * FROM \"job\" WHERE \"name\" LIKE '%veloper%' ESCAPE '!' OR \"name\" LIKE '%ian%' ESCAPE '!'"; $expectedBinds = [ - 'name' => [ + 'name' => [ '%veloper%', true, ], @@ -137,7 +137,7 @@ public function testOrNotLike() $expectedSQL = "SELECT * FROM \"job\" WHERE \"name\" LIKE '%veloper%' ESCAPE '!' OR \"name\" NOT LIKE '%ian%' ESCAPE '!'"; $expectedBinds = [ - 'name' => [ + 'name' => [ '%veloper%', true, ], diff --git a/tests/system/Database/Builder/UpdateTest.php b/tests/system/Database/Builder/UpdateTest.php index 6f07c9a14399..282dab29ba90 100644 --- a/tests/system/Database/Builder/UpdateTest.php +++ b/tests/system/Database/Builder/UpdateTest.php @@ -27,7 +27,7 @@ public function testUpdate() $expectedSQL = 'UPDATE "jobs" SET "name" = \'Programmer\' WHERE "id" = 1'; $expectedBinds = [ - 'id' => [ + 'id' => [ 1, true, ], @@ -53,7 +53,7 @@ public function testUpdateInternalWhereAndLimit() 'Programmer', true, ], - 'id' => [ + 'id' => [ 1, true, ], @@ -75,7 +75,7 @@ public function testUpdateWithSet() 'Programmer', true, ], - 'id' => [ + 'id' => [ 1, true, ], @@ -184,7 +184,7 @@ public function testUpdateWithWhereSameColumn() $expectedSQL = 'UPDATE "jobs" SET "name" = \'foobar\' WHERE "name" = \'Programmer\''; $expectedBinds = [ - 'name' => [ + 'name' => [ 'foobar', true, ], @@ -210,7 +210,7 @@ public function testUpdateWithWhereSameColumn2() $expectedSQL = 'UPDATE "jobs" SET "name" = \'foobar\' WHERE "name" = \'Programmer\''; $expectedBinds = [ - 'name' => [ + 'name' => [ 'foobar', true, ], @@ -235,7 +235,7 @@ public function testUpdateWithWhereSameColumn3() $expectedSQL = 'UPDATE "jobs" SET "name" = \'foobar\' WHERE "name" = \'Programmer\''; $expectedBinds = [ - 'name' => [ + 'name' => [ 'Programmer', true, ], @@ -289,7 +289,7 @@ public function testSetWithAndWithoutEscape() 'bar', true, ], - 'id' => [ + 'id' => [ 2, true, ], diff --git a/tests/system/Database/Builder/WhereTest.php b/tests/system/Database/Builder/WhereTest.php index a2b702686121..cce38c97978b 100644 --- a/tests/system/Database/Builder/WhereTest.php +++ b/tests/system/Database/Builder/WhereTest.php @@ -82,7 +82,7 @@ public function testWhereAssociateArray() $expectedSQL = 'SELECT * FROM "jobs" WHERE "id" = 2 AND "name" != \'Accountant\''; $expectedBinds = [ - 'id' => [ + 'id' => [ 2, true, ], @@ -135,7 +135,7 @@ public function testOrWhere() 'Accountant', true, ], - 'id' => [ + 'id' => [ 3, true, ], @@ -154,7 +154,7 @@ public function testOrWhereSameColumn() $expectedSQL = 'SELECT * FROM "jobs" WHERE "name" = \'Accountant\' OR "name" = \'foobar\''; $expectedBinds = [ - 'name' => [ + 'name' => [ 'Accountant', true, ], @@ -283,7 +283,7 @@ public function testOrWhereIn() $expectedSQL = 'SELECT * FROM "jobs" WHERE "id" = 2 OR "name" IN (\'Politician\',\'Accountant\')'; $expectedBinds = [ - 'id' => [ + 'id' => [ 2, true, ], @@ -321,7 +321,7 @@ public function testOrWhereNotIn() $expectedSQL = 'SELECT * FROM "jobs" WHERE "id" = 2 OR "name" NOT IN (\'Politician\',\'Accountant\')'; $expectedBinds = [ - 'id' => [ + 'id' => [ 2, true, ], diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php index ea118c74df77..63681115f2ad 100644 --- a/tests/system/Database/Live/ForgeTest.php +++ b/tests/system/Database/Live/ForgeTest.php @@ -108,7 +108,7 @@ public function testCreateTable() $this->forge->dropTable('forge_test_table', true); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, 'unsigned' => true, @@ -226,7 +226,7 @@ public function testCreateTableWithArrayFieldConstraints() public function testCreateTableWithNullableFieldsGivesNullDataType(): void { $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INT', 'constraint' => 11, 'auto_increment' => true, @@ -367,7 +367,7 @@ public function testForeignKey() } $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, ], @@ -380,7 +380,7 @@ public function testForeignKey() $this->forge->createTable('forge_test_users', true, $attributes); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, ], @@ -388,7 +388,7 @@ public function testForeignKey() 'type' => 'INTEGER', 'constraint' => 11, ], - 'name' => [ + 'name' => [ 'type' => 'VARCHAR', 'constraint' => 255, ], @@ -427,7 +427,7 @@ public function testForeignKeyFieldNotExistException() } $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, ], @@ -440,7 +440,7 @@ public function testForeignKeyFieldNotExistException() $this->forge->createTable('forge_test_users', true, $attributes); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, ], @@ -448,7 +448,7 @@ public function testForeignKeyFieldNotExistException() 'type' => 'INTEGER', 'constraint' => 11, ], - 'name' => [ + 'name' => [ 'type' => 'VARCHAR', 'constraint' => 255, ], @@ -468,7 +468,7 @@ public function testDropForeignKey() } $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, ], @@ -481,7 +481,7 @@ public function testDropForeignKey() $this->forge->createTable('forge_test_users', true, $attributes); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, ], @@ -489,7 +489,7 @@ public function testDropForeignKey() 'type' => 'INTEGER', 'constraint' => 11, ], - 'name' => [ + 'name' => [ 'type' => 'VARCHAR', 'constraint' => 255, ], @@ -549,7 +549,7 @@ public function testAddFields() $this->forge->dropTable('forge_test_fields', true); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, 'unsigned' => false, @@ -560,11 +560,11 @@ public function testAddFields() 'constraint' => 255, 'unique' => false, ], - 'name' => [ + 'name' => [ 'type' => 'VARCHAR', 'constraint' => 255, ], - 'active' => [ + 'active' => [ 'type' => 'INTEGER', 'constraint' => 11, 'default' => 0, @@ -641,12 +641,12 @@ public function testCompositeKey() $uniqueOrAuto = $this->db->DBDriver === 'SQLite3' ? 'unique' : 'auto_increment'; $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 3, $uniqueOrAuto => true, ], - 'code' => [ + 'code' => [ 'type' => 'VARCHAR', 'constraint' => 40, ], @@ -654,7 +654,7 @@ public function testCompositeKey() 'type' => 'VARCHAR', 'constraint' => 40, ], - 'active' => [ + 'active' => [ 'type' => 'INTEGER', 'constraint' => 1, ], @@ -715,7 +715,7 @@ public function testDropColumn() $this->forge->dropTable('forge_test_two', true); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, 'unsigned' => false, @@ -747,7 +747,7 @@ public function testModifyColumnRename() $this->forge->dropTable('forge_test_three', true); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, 'unsigned' => false, @@ -824,13 +824,13 @@ public function testDropMultipleColumnWithArray() $this->forge->dropTable('forge_test_two', true); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, 'unsigned' => false, 'auto_increment' => true, ], - 'name' => [ + 'name' => [ 'type' => 'varchar', 'constraint' => 255, 'null' => true, @@ -862,13 +862,13 @@ public function testDropMultipleColumnWithString() $this->forge->dropTable('forge_test_four', true); $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'INTEGER', 'constraint' => 11, 'unsigned' => false, 'auto_increment' => true, ], - 'name' => [ + 'name' => [ 'type' => 'varchar', 'constraint' => 255, 'null' => true, diff --git a/tests/system/Database/Live/MetadataTest.php b/tests/system/Database/Live/MetadataTest.php index c13cd100b35a..9480506a8780 100644 --- a/tests/system/Database/Live/MetadataTest.php +++ b/tests/system/Database/Live/MetadataTest.php @@ -71,7 +71,7 @@ public function testConstrainPrefixIgnoresOtherTables() // Create a table with the new prefix $fields = [ - 'name' => [ + 'name' => [ 'type' => 'varchar', 'constraint' => 31, ], diff --git a/tests/system/Database/Live/SQLite/AlterTableTest.php b/tests/system/Database/Live/SQLite/AlterTableTest.php index fd8a3c76bd78..113b77aba734 100644 --- a/tests/system/Database/Live/SQLite/AlterTableTest.php +++ b/tests/system/Database/Live/SQLite/AlterTableTest.php @@ -221,7 +221,7 @@ protected function createTable(string $tableName = 'foo') { // Create support table for foreign keys $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'integer', 'constraint' => 11, 'unsigned' => true, @@ -237,18 +237,18 @@ protected function createTable(string $tableName = 'foo') // Create main table $this->forge->addField([ - 'id' => [ + 'id' => [ 'type' => 'integer', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true, ], - 'name' => [ + 'name' => [ 'type' => 'varchar', 'constraint' => 255, 'null' => false, ], - 'email' => [ + 'email' => [ 'type' => 'varchar', 'constraint' => 255, 'null' => true, diff --git a/tests/system/Database/Live/WriteTypeQueryTest.php b/tests/system/Database/Live/WriteTypeQueryTest.php index 678f86be415c..8a44a0947424 100644 --- a/tests/system/Database/Live/WriteTypeQueryTest.php +++ b/tests/system/Database/Live/WriteTypeQueryTest.php @@ -87,7 +87,7 @@ public function testReplace() 'name' => 'My Name', 'date' => 'My date', ]; - $sql = $builder->testMode()->replace($data); + $sql = $builder->testMode()->replace($data); } $this->assertTrue($this->db->isWriteType($sql)); diff --git a/tests/system/Database/Migrations/MigrationRunnerTest.php b/tests/system/Database/Migrations/MigrationRunnerTest.php index abb26ecc8853..688f9b8d8cb0 100644 --- a/tests/system/Database/Migrations/MigrationRunnerTest.php +++ b/tests/system/Database/Migrations/MigrationRunnerTest.php @@ -197,7 +197,7 @@ public function testFindMigrationsSuccessTimestamp() $runner = $runner->setNamespace('Tests\Support\MigrationTestMigrations'); - $mig1 = (object) [ + $mig1 = (object) [ 'name' => 'Some_migration', 'path' => TESTPATH . '_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102301_Some_migration.php', 'version' => '2018-01-24-102301', @@ -206,7 +206,7 @@ public function testFindMigrationsSuccessTimestamp() ]; $mig1->uid = $runner->getObjectUid($mig1); - $mig2 = (object) [ + $mig2 = (object) [ 'name' => 'Another_migration', 'path' => TESTPATH . '_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102302_Another_migration.php', 'version' => '2018-01-24-102302', diff --git a/tests/system/EntityTest.php b/tests/system/EntityTest.php index 76a6ab699d11..536f9ce9163b 100644 --- a/tests/system/EntityTest.php +++ b/tests/system/EntityTest.php @@ -541,7 +541,7 @@ public function testCastAsJSONArray() { $entity = $this->getCastEntity(); - $data = [ + $data = [ 'Sun', 'Mon', 'Tue', diff --git a/tests/system/Filters/FiltersTest.php b/tests/system/Filters/FiltersTest.php index 279c1436de62..b590cedad5c2 100644 --- a/tests/system/Filters/FiltersTest.php +++ b/tests/system/Filters/FiltersTest.php @@ -43,7 +43,7 @@ protected function setUp(): void public function testProcessMethodDetectsCLI() { - $config = [ + $config = [ 'aliases' => ['foo' => ''], 'methods' => [ 'cli' => ['foo'], @@ -63,7 +63,7 @@ public function testProcessMethodDetectsGetRequests() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => ['foo' => ''], 'methods' => [ 'get' => ['foo'], @@ -83,7 +83,7 @@ public function testProcessMethodRespectsMethod() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -107,7 +107,7 @@ public function testProcessMethodIgnoresMethod() { $_SERVER['REQUEST_METHOD'] = 'DELETE'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -142,7 +142,7 @@ public function testProcessMethodProcessGlobals() 'foo' => ['bar'], // not excluded 'bar' ], - 'after' => [ + 'after' => [ 'baz' ], ], @@ -155,7 +155,7 @@ public function testProcessMethodProcessGlobals() 'foo', 'bar', ], - 'after' => ['baz'], + 'after' => ['baz'], ]; $this->assertEquals($expected, $filters->initialize()->getFilters()); @@ -180,7 +180,7 @@ public function testProcessMethodProcessGlobalsWithExcept(array $except) { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -191,7 +191,7 @@ public function testProcessMethodProcessGlobalsWithExcept(array $except) 'foo' => ['except' => $except], 'bar' ], - 'after' => [ + 'after' => [ 'baz' ], ], @@ -203,7 +203,7 @@ public function testProcessMethodProcessGlobalsWithExcept(array $except) 'before' => [ 'bar' ], - 'after' => ['baz'], + 'after' => ['baz'], ]; $this->assertEquals($expected, $filters->initialize($uri)->getFilters()); @@ -213,7 +213,7 @@ public function testProcessMethodProcessesFiltersBefore() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -241,7 +241,7 @@ public function testProcessMethodProcessesFiltersAfter() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -271,7 +271,7 @@ public function testProcessMethodProcessesCombined() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foog' => '', 'barg' => '', @@ -285,7 +285,7 @@ public function testProcessMethodProcessesCombined() 'foog' => ['except' => ['admin/*']], 'barg' ], - 'after' => [ + 'after' => [ 'bazg' ], ], @@ -309,7 +309,7 @@ public function testProcessMethodProcessesCombined() 'bar', 'foof', ], - 'after' => ['bazg'], + 'after' => ['bazg'], ]; $this->assertEquals($expected, $filters->initialize($uri)->getFilters()); @@ -319,7 +319,7 @@ public function testProcessMethodProcessesCombinedAfterForToolbar() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'toolbar' => '', 'bazg' => '', @@ -490,7 +490,7 @@ public function testOtherResult() 'nowhere', 'banana', ], - 'after' => [], + 'after' => [], ], ]; @@ -506,7 +506,7 @@ public function testBeforeExceptString() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -517,7 +517,7 @@ public function testBeforeExceptString() 'foo' => ['except' => 'admin/*'], 'bar' ], - 'after' => [ + 'after' => [ 'baz' ], ], @@ -529,7 +529,7 @@ public function testBeforeExceptString() 'before' => [ 'bar' ], - 'after' => ['baz'], + 'after' => ['baz'], ]; $this->assertEquals($expected, $filters->initialize($uri)->getFilters()); @@ -539,7 +539,7 @@ public function testBeforeExceptInapplicable() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -550,7 +550,7 @@ public function testBeforeExceptInapplicable() 'foo' => ['except' => 'george/*'], 'bar' ], - 'after' => [ + 'after' => [ 'baz' ], ], @@ -563,7 +563,7 @@ public function testBeforeExceptInapplicable() 'foo', 'bar', ], - 'after' => ['baz'], + 'after' => ['baz'], ]; $this->assertEquals($expected, $filters->initialize($uri)->getFilters()); @@ -573,7 +573,7 @@ public function testAfterExceptString() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -583,7 +583,7 @@ public function testAfterExceptString() 'before' => [ 'bar' ], - 'after' => [ + 'after' => [ 'foo' => ['except' => 'admin/*'], 'baz' ], @@ -596,7 +596,7 @@ public function testAfterExceptString() 'before' => [ 'bar' ], - 'after' => ['baz'], + 'after' => ['baz'], ]; $this->assertEquals($expected, $filters->initialize($uri)->getFilters()); @@ -606,7 +606,7 @@ public function testAfterExceptInapplicable() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -616,7 +616,7 @@ public function testAfterExceptInapplicable() 'before' => [ 'bar' ], - 'after' => [ + 'after' => [ 'foo' => ['except' => 'george/*'], 'baz' ], @@ -629,7 +629,7 @@ public function testAfterExceptInapplicable() 'before' => [ 'bar' ], - 'after' => [ + 'after' => [ 'foo', 'baz', ], @@ -671,7 +671,7 @@ public function testAddFilterSection() $filters = $filters->addFilter('Some\OtherClass', 'another', 'before', 'globals') ->initialize('admin/foo/bar'); - $list = $filters->getFilters(); + $list = $filters->getFilters(); $this->assertTrue(in_array('another', $list['before'], true)); } @@ -687,7 +687,7 @@ public function testInitializeTwice() $filters = $filters->addFilter('Some\OtherClass', 'another', 'before', 'globals') ->initialize('admin/foo/bar') ->initialize(); - $list = $filters->getFilters(); + $list = $filters->getFilters(); $this->assertTrue(in_array('another', $list['before'], true)); } @@ -804,7 +804,7 @@ public function testMatchesURICaseInsensitively() { $_SERVER['REQUEST_METHOD'] = 'GET'; - $config = [ + $config = [ 'aliases' => [ 'foo' => '', 'bar' => '', @@ -816,7 +816,7 @@ public function testMatchesURICaseInsensitively() 'foo' => ['except' => 'Admin/*'], 'bar' ], - 'after' => [ + 'after' => [ 'foo' => ['except' => 'Admin/*'], 'baz' ], @@ -836,7 +836,7 @@ public function testMatchesURICaseInsensitively() 'bar', 'frak', ], - 'after' => [ + 'after' => [ 'baz', 'frak', ], @@ -873,7 +873,7 @@ public function testFilterMatching() 'before' => [ 'frak', ], - 'after' => [], + 'after' => [], ]; $actual = $filters->initialize($uri)->getFilters(); @@ -898,7 +898,7 @@ public function testGlobalFilterMatching() 'foo' => ['except' => 'admin*'], 'one', ], - 'after' => [ + 'after' => [ 'foo' => ['except' => 'admin/*'], 'two', ], @@ -912,7 +912,7 @@ public function testGlobalFilterMatching() 'before' => [ 'one' ], - 'after' => [ + 'after' => [ 'foo', 'two', ], @@ -941,7 +941,7 @@ public function testCombinedFilterMatching() 'foo' => ['except' => 'admin*'], 'one', ], - 'after' => [ + 'after' => [ 'foo' => ['except' => 'admin/*'], 'two', ], @@ -962,7 +962,7 @@ public function testCombinedFilterMatching() 'one', 'frak', ], - 'after' => [ + 'after' => [ 'foo', 'two', ], @@ -988,7 +988,7 @@ public function testSegmentedFilterMatching() 'before' => [ 'foo' => ['except' => 'admin*'], ], - 'after' => [ + 'after' => [ 'foo' => ['except' => 'admin/*'], ], ], @@ -1007,7 +1007,7 @@ public function testSegmentedFilterMatching() 'before' => [ 'frak', ], - 'after' => [ + 'after' => [ 'frak', ], ]; @@ -1020,7 +1020,7 @@ public function testSegmentedFilterMatching() */ public function testFilterAlitasMultiple() { - $config = [ + $config = [ 'aliases' => [ 'multipeTest' => [ 'CodeIgniter\Filters\fixtures\Multiple1', @@ -1043,7 +1043,7 @@ public function testFilterAlitasMultiple() public function testFilterClass() { - $config = [ + $config = [ 'aliases' => [ 'multipleTest' => [ 'CodeIgniter\Filters\fixtures\Multiple1', @@ -1060,7 +1060,7 @@ public function testFilterClass() $filters->run('admin/foo/bar', 'before'); $expected = [ - 'after' => [ + 'after' => [ 'CodeIgniter\Filters\fixtures\Multiple1', 'CodeIgniter\Filters\fixtures\Multiple2', ], diff --git a/tests/system/Format/XMLFormatterTest.php b/tests/system/Format/XMLFormatterTest.php index 0b87b031d7fd..a3ca254270a4 100644 --- a/tests/system/Format/XMLFormatterTest.php +++ b/tests/system/Format/XMLFormatterTest.php @@ -74,7 +74,7 @@ public function testStringFormatting() public function testValidatingXmlTags() { - $data = [ + $data = [ 'BBB096630BD' => 'foo', '096630FR' => 'bar', ]; @@ -143,10 +143,10 @@ public function testDeepNestedArrayToXml() 'email' => 'foo@bar.com', 'dependents' => [], ], - 'vote' => [ + 'vote' => [ 'list' => [], ], - 'user' => [ + 'user' => [ 'account' => [ 'demo' => [ 'info' => [ @@ -157,7 +157,7 @@ public function testDeepNestedArrayToXml() ], ], ], - 'xml' => [ + 'xml' => [ 'xml_version' => '1.0', 'xml_encoding' => 'utf-8', ], diff --git a/tests/system/HTTP/CLIRequestTest.php b/tests/system/HTTP/CLIRequestTest.php index 6d09bb260590..639603a44e1a 100644 --- a/tests/system/HTTP/CLIRequestTest.php +++ b/tests/system/HTTP/CLIRequestTest.php @@ -364,7 +364,7 @@ public function testFetchGlobalReturnsArrayValues() 'DETAIL' => 'sdfg', ], ], - 'submit' => 'SAVE', + 'submit' => 'SAVE', ]; $this->request->setGlobal('post', $post); $result = $this->request->fetchGlobal('post'); @@ -431,7 +431,7 @@ public function testFetchGlobalWithKeylessArrayChildElement() 'address' => [ 'zipcode' => 90210, ], - 'stuff' => [['a']], + 'stuff' => [['a']], ], ]; $this->request->setGlobal('post', $post); @@ -467,7 +467,7 @@ public function testFetchGlobalWithEmptyNotation() ], ], ]; - $post = [ + $post = [ 'clients' => $expected, ]; $this->request->setGlobal('post', $post); @@ -480,38 +480,38 @@ public function testFetchGlobalWithEmptyNotation() public function ipAddressChecks() { return [ - 'empty' => [ + 'empty' => [ false, '', ], - 'zero' => [ + 'zero' => [ false, 0, ], - 'large_ipv4' => [ + 'large_ipv4' => [ false, '256.256.256.999', 'ipv4', ], - 'good_ipv4' => [ + 'good_ipv4' => [ true, '100.100.100.0', 'ipv4', ], - 'good_default' => [ + 'good_default' => [ true, '100.100.100.0', ], - 'zeroed_ipv4' => [ + 'zeroed_ipv4' => [ true, '0.0.0.0', ], - 'large_ipv6' => [ + 'large_ipv6' => [ false, 'h123:0000:0000:0000:0000:0000:0000:0000', 'ipv6', ], - 'good_ipv6' => [ + 'good_ipv6' => [ true, '2001:0db8:85a3:0000:0000:8a2e:0370:7334', ], diff --git a/tests/system/HTTP/CURLRequestTest.php b/tests/system/HTTP/CURLRequestTest.php index 6b9cb82a3d3f..2a675337df52 100644 --- a/tests/system/HTTP/CURLRequestTest.php +++ b/tests/system/HTTP/CURLRequestTest.php @@ -876,8 +876,8 @@ public function testPostFormEncoded() public function testPostFormMultipart() { $params = [ - 'foo' => 'bar', - 'baz' => [ + 'foo' => 'bar', + 'baz' => [ 'hi', 'there', ], diff --git a/tests/system/HTTP/Files/FileCollectionTest.php b/tests/system/HTTP/Files/FileCollectionTest.php index 86acc4a92d08..7060b73c42f3 100644 --- a/tests/system/HTTP/Files/FileCollectionTest.php +++ b/tests/system/HTTP/Files/FileCollectionTest.php @@ -53,15 +53,15 @@ public function testAllReturnsValidMultipleFilesSameName() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'fileA.txt', 'fileB.txt', ], - 'type' => [ + 'type' => [ 'text/plain', 'text/csv', ], - 'size' => [ + 'size' => [ '124', '248', ], @@ -69,7 +69,7 @@ public function testAllReturnsValidMultipleFilesSameName() '/tmp/fileA.txt', '/tmp/fileB.txt', ], - 'error' => 0, + 'error' => 0, ], ]; @@ -225,17 +225,17 @@ public function testAllReturnsValidSingleFileNestedName() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'foo' => [ 'bar' => 'fileA.txt', ], ], - 'type' => [ + 'type' => [ 'foo' => [ 'bar' => 'text/plain', ], ], - 'size' => [ + 'size' => [ 'foo' => [ 'bar' => 124, ], @@ -245,7 +245,7 @@ public function testAllReturnsValidSingleFileNestedName() 'bar' => '/tmp/fileA.txt', ], ], - 'error' => 0, + 'error' => 0, ], ]; @@ -322,17 +322,17 @@ public function testHasFileWithSingleFileNestedName() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'foo' => [ 'bar' => 'fileA.txt', ], ], - 'type' => [ + 'type' => [ 'foo' => [ 'bar' => 'text/plain', ], ], - 'size' => [ + 'size' => [ 'foo' => [ 'bar' => 124, ], @@ -342,7 +342,7 @@ public function testHasFileWithSingleFileNestedName() 'bar' => '/tmp/fileA.txt', ], ], - 'error' => 0, + 'error' => 0, ], ]; @@ -516,15 +516,15 @@ public function testFileReturnValidMultipleFiles() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'fileA.txt', 'fileB.txt', ], - 'type' => [ + 'type' => [ 'text/plain', 'text/csv', ], - 'size' => [ + 'size' => [ '124', '248', ], @@ -532,7 +532,7 @@ public function testFileReturnValidMultipleFiles() '/tmp/fileA.txt', '/tmp/fileB.txt', ], - 'error' => 0, + 'error' => 0, ], ]; @@ -561,7 +561,7 @@ public function testFileWithMultipleFilesNestedName() { $_FILES = [ 'my-form' => [ - 'name' => [ + 'name' => [ 'details' => [ 'avatars' => [ 'fileA.txt', @@ -569,7 +569,7 @@ public function testFileWithMultipleFilesNestedName() ], ], ], - 'type' => [ + 'type' => [ 'details' => [ 'avatars' => [ 'text/plain', @@ -577,7 +577,7 @@ public function testFileWithMultipleFilesNestedName() ], ], ], - 'size' => [ + 'size' => [ 'details' => [ 'avatars' => [ 125, @@ -593,7 +593,7 @@ public function testFileWithMultipleFilesNestedName() ], ], ], - 'error' => [ + 'error' => [ 'details' => [ 'avatars' => [ 0, @@ -629,7 +629,7 @@ public function testDoesntHaveFile() { $_FILES = [ 'my-form' => [ - 'name' => [ + 'name' => [ 'details' => [ 'avatars' => [ 'fileA.txt', @@ -637,7 +637,7 @@ public function testDoesntHaveFile() ], ], ], - 'type' => [ + 'type' => [ 'details' => [ 'avatars' => [ 'text/plain', @@ -645,7 +645,7 @@ public function testDoesntHaveFile() ], ], ], - 'size' => [ + 'size' => [ 'details' => [ 'avatars' => [ 125, @@ -661,7 +661,7 @@ public function testDoesntHaveFile() ], ], ], - 'error' => [ + 'error' => [ 'details' => [ 'avatars' => [ 0, @@ -684,15 +684,15 @@ public function testGetFileMultipleHasNoFile() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'fileA.txt', 'fileB.txt', ], - 'type' => [ + 'type' => [ 'text/plain', 'text/csv', ], - 'size' => [ + 'size' => [ '124', '248', ], @@ -700,7 +700,7 @@ public function testGetFileMultipleHasNoFile() '/tmp/fileA.txt', '/tmp/fileB.txt', ], - 'error' => 0, + 'error' => 0, ], ]; @@ -717,7 +717,7 @@ public function testGetFileMultipleReturnValidDotNotationSyntax() { $_FILES = [ 'my-form' => [ - 'name' => [ + 'name' => [ 'details' => [ 'avatars' => [ 'fileA.txt', @@ -725,7 +725,7 @@ public function testGetFileMultipleReturnValidDotNotationSyntax() ], ], ], - 'type' => [ + 'type' => [ 'details' => [ 'avatars' => [ 'text/plain', @@ -733,7 +733,7 @@ public function testGetFileMultipleReturnValidDotNotationSyntax() ], ], ], - 'size' => [ + 'size' => [ 'details' => [ 'avatars' => [ 125, @@ -749,7 +749,7 @@ public function testGetFileMultipleReturnValidDotNotationSyntax() ], ], ], - 'error' => [ + 'error' => [ 'details' => [ 'avatars' => [ 0, @@ -787,17 +787,17 @@ public function testGetFileMultipleReturnInvalidDotNotationSyntax() { $_FILES = [ 'my-form' => [ - 'name' => [ + 'name' => [ 'details' => [ 'avatars' => 'fileA.txt', ], ], - 'type' => [ + 'type' => [ 'details' => [ 'avatars' => 'text/plain', ], ], - 'size' => [ + 'size' => [ 'details' => [ 'avatars' => 243, ], @@ -807,7 +807,7 @@ public function testGetFileMultipleReturnInvalidDotNotationSyntax() 'avatars' => '/tmp/fileA.txt', ], ], - 'error' => [ + 'error' => [ 'details' => [ 'avatars' => 0, ], @@ -827,15 +827,15 @@ public function testGetFileMultipleReturnValidMultipleFiles() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'fileA.txt', 'fileB.txt', ], - 'type' => [ + 'type' => [ 'text/plain', 'text/csv', ], - 'size' => [ + 'size' => [ '124', '248', ], @@ -843,7 +843,7 @@ public function testGetFileMultipleReturnValidMultipleFiles() '/tmp/fileA.txt', '/tmp/fileB.txt', ], - 'error' => 0, + 'error' => 0, ], ]; diff --git a/tests/system/HTTP/IncomingRequestDetectingTest.php b/tests/system/HTTP/IncomingRequestDetectingTest.php index d5a73b8a97dc..4767b1cad35c 100644 --- a/tests/system/HTTP/IncomingRequestDetectingTest.php +++ b/tests/system/HTTP/IncomingRequestDetectingTest.php @@ -20,8 +20,10 @@ protected function setUp(): void { parent::setUp(); - $_POST = $_GET = $_SERVER = $_REQUEST = $_ENV = $_COOKIE = $_SESSION = []; - $origin = 'http://www.example.com/index.php/woot?code=good#pos'; + $_POST = $_GET = $_SERVER = $_REQUEST = $_ENV = $_COOKIE = $_SESSION = []; + + $origin = 'http://www.example.com/index.php/woot?code=good#pos'; + $this->request = new IncomingRequest(new App(), new URI($origin), null, new UserAgent()); } diff --git a/tests/system/HTTP/IncomingRequestTest.php b/tests/system/HTTP/IncomingRequestTest.php index a3785ae1380d..9be738643f62 100644 --- a/tests/system/HTTP/IncomingRequestTest.php +++ b/tests/system/HTTP/IncomingRequestTest.php @@ -125,7 +125,7 @@ public function testCanSerializeOldArray() 'BC' => 'British Columbia', 'SK' => 'Saskatchewan', ]; - $session = service('session'); + $session = service('session'); $session->set(['_ci_old_input' => ['post' => ['location' => $locations]]]); $this->assertEquals($locations, $this->request->getOldInput('location')); @@ -178,8 +178,8 @@ public function testSetLocaleSaves() 'en', 'es', ]; - $config->defaultLocale = 'es'; - $config->baseURL = 'http://example.com/'; + $config->defaultLocale = 'es'; + $config->baseURL = 'http://example.com/'; $request = new IncomingRequest($config, new URI(), null, new UserAgent()); @@ -194,8 +194,8 @@ public function testSetBadLocale() 'en', 'es', ]; - $config->defaultLocale = 'es'; - $config->baseURL = 'http://example.com/'; + $config->defaultLocale = 'es'; + $config->baseURL = 'http://example.com/'; $request = new IncomingRequest($config, new URI(), null, new UserAgent()); @@ -218,7 +218,7 @@ public function testNegotiatesLocale() 'fr', 'en', ]; - $config->baseURL = 'http://example.com/'; + $config->baseURL = 'http://example.com/'; $request = new IncomingRequest($config, new URI(), null, new UserAgent()); @@ -236,7 +236,7 @@ public function testNegotiatesLocaleOnlyBroad() 'fr', 'en', ]; - $config->baseURL = 'http://example.com/'; + $config->baseURL = 'http://example.com/'; $request = new IncomingRequest($config, new URI(), null, new UserAgent()); @@ -309,7 +309,7 @@ public function testCanGetAVariableFromJson() 'fizz' => 'buzz', ], ]; - $json = json_encode($jsonObj); + $json = json_encode($jsonObj); $config = new App(); $config->baseURL = 'http://example.com/'; @@ -331,7 +331,7 @@ public function testGetJsonVarAsArray() 'foo' => 'bar', ], ]; - $json = json_encode($jsonObj); + $json = json_encode($jsonObj); $config = new App(); $config->baseURL = 'http://example.com/'; @@ -362,7 +362,7 @@ public function testGetVarWorksWithJson() 'foo' => 'bar', 'fizz' => 'buzz', ]; - $json = json_encode($jsonObj); + $json = json_encode($jsonObj); $config = new App(); $config->baseURL = 'http://example.com/'; @@ -505,15 +505,15 @@ public function testGetFileMultiple() { $_FILES = [ 'userfile' => [ - 'name' => [ + 'name' => [ 'someFile.txt', 'someFile2.txt', ], - 'type' => [ + 'type' => [ 'text/plain', 'text/plain', ], - 'size' => [ + 'size' => [ '124', '125', ], @@ -521,7 +521,7 @@ public function testGetFileMultiple() '/tmp/myTempFile.txt', '/tmp/myTempFile2.txt', ], - 'error' => [ + 'error' => [ 0, 0, ], @@ -597,7 +597,7 @@ public function providePathChecks() '/test.php', '/', ], - '/index.php' => [ + '/index.php' => [ '/index.php', '/', ], diff --git a/tests/system/HTTP/MessageTest.php b/tests/system/HTTP/MessageTest.php index e5ef09cef82c..be6f2e2e3cf0 100644 --- a/tests/system/HTTP/MessageTest.php +++ b/tests/system/HTTP/MessageTest.php @@ -220,7 +220,7 @@ public function provideArrayHeaderValue() 'xml', ], ], - 'existing for next append' => [ + 'existing for next append' => [ [ 'json', 'html', diff --git a/tests/system/HTTP/RequestTest.php b/tests/system/HTTP/RequestTest.php index 37eae02ba130..afb0595fe10f 100644 --- a/tests/system/HTTP/RequestTest.php +++ b/tests/system/HTTP/RequestTest.php @@ -179,7 +179,7 @@ public function testFetchGlobalReturnsArrayValues() 'DETAIL' => 'sdfg', ], ], - 'submit' => 'SAVE', + 'submit' => 'SAVE', ]; $this->request->setGlobal('post', $post); $result = $this->request->fetchGlobal('post'); @@ -246,7 +246,7 @@ public function testFetchGlobalWithKeylessArrayChildElement() 'address' => [ 'zipcode' => 90210, ], - 'stuff' => [['a']], + 'stuff' => [['a']], ], ]; $this->request->setGlobal('post', $post); @@ -282,7 +282,7 @@ public function testFetchGlobalWithEmptyNotation() ], ], ]; - $post = [ + $post = [ 'clients' => $expected, ]; $this->request->setGlobal('post', $post); @@ -301,7 +301,7 @@ public function testFetchGlobalFiltersWithNull() 'street' => false, 'zipcode' => 91210, ], - 'people' => [ + 'people' => [ [ 'name' => false, 'age' => 26, @@ -324,14 +324,14 @@ public function testFetchGlobalFiltersWithNull() ], ], ]; - $post = [ + $post = [ 'foo' => 'bar', 'number' => '5', 'address' => [ 'street' => 'Beverly Hills', 'zipcode' => '91210', ], - 'people' => [ + 'people' => [ [ 'name' => 'Brandon', 'age' => '26', @@ -383,14 +383,14 @@ public function testFetchGlobalFiltersWithValue() ], ], ]; - $post = [ + $post = [ 'foo' => 'bar', 'number' => '5', 'address' => [ 'street' => 'Beverly Hills', 'zipcode' => '91210', ], - 'people' => [ + 'people' => [ [ 'name' => 'Brandon', 'age' => '26', @@ -425,7 +425,7 @@ public function testFetchGlobalFiltersWithValues() 'street' => false, 'zipcode' => 91210, ], - 'people' => [ + 'people' => [ [ 'name' => false, 'age' => 26, @@ -448,14 +448,14 @@ public function testFetchGlobalFiltersWithValues() ], ], ]; - $post = [ + $post = [ 'foo' => 'bar', 'number' => '5', 'address' => [ 'street' => 'Beverly Hills', 'zipcode' => '91210', ], - 'people' => [ + 'people' => [ [ 'name' => 'Brandon', 'age' => '26', @@ -495,14 +495,14 @@ public function testFetchGlobalFiltersWithArrayChildElement() ], ], ]; - $post = [ + $post = [ 'foo' => 'bar', 'number' => '5', 'address' => [ 'street' => 'Beverly Hills', 'zipcode' => '91210', ], - 'people' => [ + 'people' => [ [ 'name' => 'Brandon', 'age' => '26', @@ -535,38 +535,38 @@ public function testFetchGlobalFiltersWithArrayChildElement() public function ipAddressChecks() { return [ - 'empty' => [ + 'empty' => [ false, '', ], - 'zero' => [ + 'zero' => [ false, 0, ], - 'large_ipv4' => [ + 'large_ipv4' => [ false, '256.256.256.999', 'ipv4', ], - 'good_ipv4' => [ + 'good_ipv4' => [ true, '100.100.100.0', 'ipv4', ], - 'good_default' => [ + 'good_default' => [ true, '100.100.100.0', ], - 'zeroed_ipv4' => [ + 'zeroed_ipv4' => [ true, '0.0.0.0', ], - 'large_ipv6' => [ + 'large_ipv6' => [ false, 'h123:0000:0000:0000:0000:0000:0000:0000', 'ipv6', ], - 'good_ipv6' => [ + 'good_ipv6' => [ true, '2001:0db8:85a3:0000:0000:8a2e:0370:7334', ], diff --git a/tests/system/HTTP/ResponseTest.php b/tests/system/HTTP/ResponseTest.php index 8621385d3d9b..3537dd7c4740 100644 --- a/tests/system/HTTP/ResponseTest.php +++ b/tests/system/HTTP/ResponseTest.php @@ -345,7 +345,7 @@ public function testSetCookieSuccessOnPrefix() public function testJSONWithArray() { - $body = [ + $body = [ 'foo' => 'bar', 'bar' => [ 1, @@ -364,7 +364,7 @@ public function testJSONWithArray() public function testJSONGetFromNormalBody() { - $body = [ + $body = [ 'foo' => 'bar', 'bar' => [ 1, @@ -384,7 +384,7 @@ public function testJSONGetFromNormalBody() public function testXMLWithArray() { - $body = [ + $body = [ 'foo' => 'bar', 'bar' => [ 1, @@ -403,7 +403,7 @@ public function testXMLWithArray() public function testXMLGetFromNormalBody() { - $body = [ + $body = [ 'foo' => 'bar', 'bar' => [ 1, diff --git a/tests/system/HTTP/URITest.php b/tests/system/HTTP/URITest.php index 89d90cfabf91..20390c829b29 100644 --- a/tests/system/HTTP/URITest.php +++ b/tests/system/HTTP/URITest.php @@ -352,15 +352,15 @@ public function testSetPathSetsValue() public function invalidPaths() { return [ - 'dot-segment' => [ + 'dot-segment' => [ '/./path/to/nowhere', '/path/to/nowhere', ], - 'double-dots' => [ + 'double-dots' => [ '/../path/to/nowhere', '/path/to/nowhere', ], - 'start-dot' => [ + 'start-dot' => [ './path/to/nowhere', '/path/to/nowhere', ], @@ -368,11 +368,11 @@ public function invalidPaths() '../path/to/nowhere', '/path/to/nowhere', ], - 'decoded' => [ + 'decoded' => [ '../%41path', '/Apath', ], - 'encoded' => [ + 'encoded' => [ '/path^here', '/path%5Ehere', ], @@ -491,15 +491,15 @@ public function testSetQueryThrowsErrorWhenFragmentPresentSilent() public function authorityInfo() { return [ - 'host-only' => [ + 'host-only' => [ 'http://foo.com/bar', 'foo.com', ], - 'host-port' => [ + 'host-port' => [ 'http://foo.com:3000/bar', 'foo.com:3000', ], - 'user-host' => [ + 'user-host' => [ 'http://me@foo.com/bar', 'me@foo.com', ], @@ -526,7 +526,7 @@ public function testAuthorityReturnsExceptedValues($url, $expected) public function defaultPorts() { return [ - 'http' => [ + 'http' => [ 'http', 80, ], diff --git a/tests/system/Helpers/ArrayHelperTest.php b/tests/system/Helpers/ArrayHelperTest.php index 8ea95d659861..6c8870b91c4a 100644 --- a/tests/system/Helpers/ArrayHelperTest.php +++ b/tests/system/Helpers/ArrayHelperTest.php @@ -37,7 +37,7 @@ public function testArrayDotTooManyLevels() public function testArrayDotEscape() { $data = [ - 'foo' => [ + 'foo' => [ 'bar.baz' => 23, ], 'foo.bar' => [ @@ -123,7 +123,7 @@ public function testArrayDotWildcardWithMultipleChoices() 'buzz' => [ 'fizz' => 11, ], - 'bar' => [ + 'bar' => [ 'baz' => 23, ], ], @@ -140,7 +140,7 @@ public function testArrayDotNestedNotFound() 'buzz' => [ 'fizz' => 11, ], - 'bar' => [ + 'bar' => [ 'baz' => 23, ], ], @@ -425,10 +425,10 @@ public function arrayFlattenProvider(): iterable 'bar' => 2, 'baz' => 3, ], - 0 => [ + 0 => [ 'fizz' => 4, ], - 1 => [ + 1 => [ 'buzz' => 5, ], ], diff --git a/tests/system/Helpers/FilesystemHelperTest.php b/tests/system/Helpers/FilesystemHelperTest.php index ea9b378646ef..84c020b309c9 100644 --- a/tests/system/Helpers/FilesystemHelperTest.php +++ b/tests/system/Helpers/FilesystemHelperTest.php @@ -16,11 +16,11 @@ protected function setUp(): void parent::setUp(); $this->structure = [ - 'foo' => [ + 'foo' => [ 'bar' => 'Once upon a midnight dreary', 'baz' => 'While I pondered weak and weary', ], - 'boo' => [ + 'boo' => [ 'far' => 'Upon a tome of long-forgotten lore', 'faz' => 'There came a tapping up on the door', ], @@ -38,11 +38,11 @@ public function testDirectoryMapDefaults() $this->assertTrue(function_exists('directory_map')); $expected = [ - 'foo' . DIRECTORY_SEPARATOR => [ + 'foo' . DIRECTORY_SEPARATOR => [ 'bar', 'baz', ], - 'boo' . DIRECTORY_SEPARATOR => [ + 'boo' . DIRECTORY_SEPARATOR => [ 'far', 'faz', ], diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index 5c68f6429258..45c8277f8ecb 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -178,7 +178,7 @@ public function testFormOpenWithHidden() 'id' => 'form', 'method' => 'POST', ]; - $hidden = [ + $hidden = [ 'foo' => 'bar', ]; $this->assertEquals($expected, form_open('foo/bar', $attributes, $hidden)); @@ -235,7 +235,7 @@ public function testFormHidden() // ------------------------------------------------------------------------ public function testFormHiddenArrayInput() { - $data = [ + $data = [ 'foo' => 'bar', ]; $expected = << 'bar', ]; $expected = <<\n EOH; - $data = [ + $data = [ 'name' => 'username', 'id' => 'username', 'value' => 'johndoe', @@ -282,12 +282,12 @@ public function testFormInputWithExtra() $expected = <<\n EOH; - $data = [ + $data = [ 'id' => 'identity', 'name' => 'identity', 'type' => 'email', ]; - $extra = [ + $extra = [ 'class' => 'form-control form-control-lg', ]; $this->assertEquals($expected, form_input($data, '', $extra)); @@ -323,7 +323,7 @@ public function testFormTextarea() // ------------------------------------------------------------------------ public function testFormTextareaWithValueAttribute() { - $data = [ + $data = [ 'name' => 'foo', 'value' => 'bar', ]; @@ -337,7 +337,7 @@ public function testFormTextareaWithValueAttribute() // ------------------------------------------------------------------------ public function testFormTextareaExtraRowsColsArray() { - $extra = [ + $extra = [ 'cols' => '30', 'rows' => '5', ]; @@ -368,14 +368,14 @@ public function testFormDropdown() \n EOH; - $options = [ + $options = [ 'small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', 'xlarge' => 'Extra Large Shirt', ]; $this->assertEquals($expected, form_dropdown('shirts', $options, 'large')); - $expected = << @@ -388,12 +388,12 @@ public function testFormDropdown() 'large', ]; $this->assertEquals($expected, form_dropdown('shirts', $options, $shirtsOnSale)); - $options = [ + $options = [ 'Swedish Cars' => [ 'volvo' => 'Volvo', 'saab' => 'Saab', ], - 'German Cars' => [ + 'German Cars' => [ 'mercedes' => 'Mercedes', 'audi' => 'Audi', ], @@ -415,12 +415,12 @@ public function testFormDropdown() public function testFormDropdownUnselected() { - $options = [ + $options = [ 'Swedish Cars' => [ 'volvo' => 'Volvo', 'saab' => 'Saab', ], - 'German Cars' => [ + 'German Cars' => [ 'mercedes' => 'Mercedes', 'audi' => 'Audi', ], @@ -442,17 +442,17 @@ public function testFormDropdownUnselected() public function testFormDropdownInferred() { - $options = [ + $options = [ 'Swedish Cars' => [ 'volvo' => 'Volvo', 'saab' => 'Saab', ], - 'German Cars' => [ + 'German Cars' => [ 'mercedes' => 'Mercedes', 'audi' => 'Audi', ], ]; - $expected = << @@ -478,11 +478,11 @@ public function testFormDropdownWithSelectedAttribute() EOH; - $data = [ + $data = [ 'name' => 'foo', 'selected' => 'bar', ]; - $options = [ + $options = [ 'bar' => 'Bar', ]; $this->assertEquals($expected, form_dropdown($data, $options)); @@ -497,7 +497,7 @@ public function testFormDropdownWithOptionsAttribute() EOH; - $data = [ + $data = [ 'name' => 'foo', 'options' => [ 'bar' => 'Bar', @@ -514,7 +514,7 @@ public function testFormDropdownWithEmptyArrayOptionValue() EOH; - $options = [ + $options = [ 'bar' => [], ]; $this->assertEquals($expected, form_dropdown('foo', $options)); @@ -531,7 +531,7 @@ public function testFormMultiselect() \n EOH; - $options = [ + $options = [ 'small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', @@ -551,7 +551,7 @@ public function testFormMultiselectArrayData() \n EOH; - $options = [ + $options = [ 'small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', @@ -596,7 +596,7 @@ public function testFormFieldsetWithAttributes() $attributes = [ 'name' => 'bar', ]; - $expected = << Foo @@ -625,7 +625,7 @@ public function testFormCheckbox() // ------------------------------------------------------------------------ public function testFormCheckboxArrayData() { - $data = [ + $data = [ 'name' => 'foo', 'value' => 'bar', 'checked' => true, @@ -640,7 +640,7 @@ public function testFormCheckboxArrayData() // ------------------------------------------------------------------------ public function testFormCheckboxArrayDataWithCheckedFalse() { - $data = [ + $data = [ 'name' => 'foo', 'value' => 'bar', 'checked' => false, @@ -685,7 +685,7 @@ public function testFormLabelWithAttributes() $attributes = [ 'id' => 'label1', ]; - $expected = <<bar EOH; $this->assertEquals($expected, form_label('bar', 'foo', $attributes)); @@ -712,7 +712,7 @@ public function testFormButton() // ------------------------------------------------------------------------ public function testFormButtonWithDataArray() { - $data = [ + $data = [ 'name' => 'foo', 'content' => 'bar', ]; @@ -735,7 +735,7 @@ public function testFormClose() // ------------------------------------------------------------------------ public function testFormDatalist() { - $options = [ + $options = [ 'foo1', 'bar1', ]; diff --git a/tests/system/Helpers/HTMLHelperTest.php b/tests/system/Helpers/HTMLHelperTest.php index 7281fa13a1b9..2355007e4090 100755 --- a/tests/system/Helpers/HTMLHelperTest.php +++ b/tests/system/Helpers/HTMLHelperTest.php @@ -266,7 +266,7 @@ public function testLinkTagComplete() public function testLinkTagArray() { - $parms = [ + $parms = [ 'href' => 'css/mystyles.css', 'indexPage' => true, ]; @@ -485,7 +485,7 @@ public function testMediaWithSources() EOH; - $sources = [ + $sources = [ source('sound.ogg', 'audio/ogg'), source('sound.mpeg', 'audio/mpeg'), ]; @@ -547,8 +547,8 @@ public function testObjectWithParams() EOH; - $type = 'application/x-shockwave-flash'; - $parms = [ + $type = 'application/x-shockwave-flash'; + $parms = [ param('foo', 'bar', 'ref', 'class="test"'), param('hello', 'world', 'ref', 'class="test"'), ]; diff --git a/tests/system/Helpers/InflectorHelperTest.php b/tests/system/Helpers/InflectorHelperTest.php index 9d76f155c3ed..687f7a8abb4c 100755 --- a/tests/system/Helpers/InflectorHelperTest.php +++ b/tests/system/Helpers/InflectorHelperTest.php @@ -201,7 +201,7 @@ public function testHumanize() 'Hello_From_CodeIgniter_4', 'Hello From CodeIgniter 4', ]; - $dashed = [ + $dashed = [ 'hello-world', 'Hello World', ]; diff --git a/tests/system/Helpers/TextHelperTest.php b/tests/system/Helpers/TextHelperTest.php index a0753c5dd8ce..9ee8ebb306ff 100755 --- a/tests/system/Helpers/TextHelperTest.php +++ b/tests/system/Helpers/TextHelperTest.php @@ -23,7 +23,7 @@ public function testStripSlashes() "Is your name O'reilly?", "No, my name is O'connor.", ]; - $str = [ + $str = [ "Is your name O\'reilly?", "No, my name is O\'connor.", ]; @@ -198,7 +198,7 @@ public function testCensoredWords() 'ass', 'fart', ]; - $strs = [ + $strs = [ 'Ted bobbled the ball' => 'Ted bobbled the ball', 'Jake is a nerdo' => 'Jake is a nerdo', 'The borg will assimilate you' => 'The borg will assimilate you', @@ -241,7 +241,7 @@ public function testHighlightPhrase() public function testEllipsize() { $strs = [ - '0' => [ + '0' => [ 'this is my string' => '… my string', "here's another one" => '…nother one', 'this one is just a bit longer' => '…bit longer', @@ -253,7 +253,7 @@ public function testEllipsize() 'this one is just a bit longer' => 'this …onger', 'short' => 'short', ], - '1' => [ + '1' => [ 'this is my string' => 'this is my…', "here's another one" => "here's ano…", 'this one is just a bit longer' => 'this one i…', diff --git a/tests/system/Models/InsertModelTest.php b/tests/system/Models/InsertModelTest.php index 25f47a8ed005..2b6d3d7fef66 100644 --- a/tests/system/Models/InsertModelTest.php +++ b/tests/system/Models/InsertModelTest.php @@ -161,7 +161,7 @@ public function testInsertBatchNewEntityWithDateTime(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; @@ -219,7 +219,7 @@ public function testInsertEntityWithNoDataExceptionNoAllowedData(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; diff --git a/tests/system/Models/SaveModelTest.php b/tests/system/Models/SaveModelTest.php index aeb7be09a110..ba5c4dbead7c 100644 --- a/tests/system/Models/SaveModelTest.php +++ b/tests/system/Models/SaveModelTest.php @@ -212,7 +212,7 @@ public function testSaveNewEntityWithDateTime(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; @@ -242,13 +242,13 @@ public function testSaveNewEntityWithDate(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; - $testModel = new class extends Model { - protected $table = 'empty'; - protected $allowedFields = [ + $testModel = new class extends Model { + protected $table = 'empty'; + protected $allowedFields = [ 'name', ]; protected $returnType = 'object'; diff --git a/tests/system/Models/UpdateModelTest.php b/tests/system/Models/UpdateModelTest.php index 983ea09b15cc..eeb58cbd60ad 100644 --- a/tests/system/Models/UpdateModelTest.php +++ b/tests/system/Models/UpdateModelTest.php @@ -162,7 +162,7 @@ public function testUpdateBatchWithEntity(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; @@ -182,7 +182,7 @@ public function testUpdateBatchWithEntity(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; @@ -311,7 +311,7 @@ public function testUpdateWithEntityNoAllowedFields(): void 'updated_at', 'deleted_at', ], - 'casts' => [], + 'casts' => [], ]; }; diff --git a/tests/system/Models/ValidationModelTest.php b/tests/system/Models/ValidationModelTest.php index 5db8ab950d5e..da996aaf3e06 100644 --- a/tests/system/Models/ValidationModelTest.php +++ b/tests/system/Models/ValidationModelTest.php @@ -70,7 +70,7 @@ public function testValidationWithSetValidationRules(): void ]; $this->model->setValidationRules([ - 'name' => [ + 'name' => [ 'rules' => 'required', 'errors' => [ 'required' => 'Give me a name baby.', @@ -204,7 +204,7 @@ public function testValidationWithGroupName(): void $config = new Validation(); $config->grouptest = [ - 'name' => [ + 'name' => [ 'required', 'min_length[3]', ], diff --git a/tests/system/Pager/PagerRendererTest.php b/tests/system/Pager/PagerRendererTest.php index 3e3f5ffa43f4..f5884f1ec83d 100644 --- a/tests/system/Pager/PagerRendererTest.php +++ b/tests/system/Pager/PagerRendererTest.php @@ -571,7 +571,7 @@ public function testGetPageNumber() 'total' => 100, 'segment' => 2, ]; - $pager = new PagerRenderer($details); + $pager = new PagerRenderer($details); $this->assertEquals(1, $pager->getFirstPageNumber()); $this->assertEquals(3, $pager->getCurrentPageNumber()); @@ -588,7 +588,7 @@ public function testGetPageNumberSetSurroundCount() 'total' => 100, 'segment' => 2, ]; - $pager = new PagerRenderer($details); + $pager = new PagerRenderer($details); $pager->setSurroundCount(2); $this->assertEquals(3, $pager->getFirstPageNumber()); @@ -605,7 +605,7 @@ public function testGetPreviousPageNumber() 'total' => 100, 'segment' => 2, ]; - $pager = new PagerRenderer($details); + $pager = new PagerRenderer($details); $pager->setSurroundCount(2); $this->assertEquals(4, $pager->getPreviousPageNumber()); @@ -620,7 +620,7 @@ public function testGetPreviousPageNumberNull() 'total' => 100, 'segment' => 2, ]; - $pager = new PagerRenderer($details); + $pager = new PagerRenderer($details); $pager->setSurroundCount(2); $this->assertNull($pager->getPreviousPageNumber()); @@ -635,7 +635,7 @@ public function testGetNextPageNumber() 'total' => 100, 'segment' => 2, ]; - $pager = new PagerRenderer($details); + $pager = new PagerRenderer($details); $pager->setSurroundCount(2); $this->assertEquals(6, $pager->getNextPageNumber()); @@ -650,7 +650,7 @@ public function testGetNextPageNumberNull() 'total' => 100, 'segment' => 2, ]; - $pager = new PagerRenderer($details); + $pager = new PagerRenderer($details); $pager->setSurroundCount(2); $this->assertNull($pager->getNextPageNumber()); diff --git a/tests/system/Pager/PagerTest.php b/tests/system/Pager/PagerTest.php index dc42156d1e3a..b14ab9a602ad 100644 --- a/tests/system/Pager/PagerTest.php +++ b/tests/system/Pager/PagerTest.php @@ -287,7 +287,7 @@ public function testGetNextURIWithQueryStringUsesCurrentURI() public function testGetPreviousURIWithQueryStringUsesCurrentURI() { - $_GET = [ + $_GET = [ 'page_foo' => 1, 'status' => 1, ]; @@ -301,7 +301,7 @@ public function testGetPreviousURIWithQueryStringUsesCurrentURI() public function testGetOnlyQueries() { - $_GET = [ + $_GET = [ 'page' => 2, 'search' => 'foo', 'order' => 'asc', diff --git a/tests/system/RESTful/ResourceControllerTest.php b/tests/system/RESTful/ResourceControllerTest.php index c00ba5d05b89..6e4870a272fc 100644 --- a/tests/system/RESTful/ResourceControllerTest.php +++ b/tests/system/RESTful/ResourceControllerTest.php @@ -72,11 +72,12 @@ public function tearDown(): void public function testResourceGet() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', ]; - $_SERVER['argc'] = 2; + $_SERVER['argc'] = 2; + $_SERVER['REQUEST_URI'] = '/work'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -89,12 +90,13 @@ public function testResourceGet() public function testResourceGetNew() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'new', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/new'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -107,13 +109,14 @@ public function testResourceGetNew() public function testResourceGetEdit() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', '1', 'edit', ]; - $_SERVER['argc'] = 4; + $_SERVER['argc'] = 4; + $_SERVER['REQUEST_URI'] = '/work/1/edit'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -126,12 +129,13 @@ public function testResourceGetEdit() public function testResourceGetOne() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', '1', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/1'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -144,11 +148,12 @@ public function testResourceGetOne() public function testResourcePost() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', ]; - $_SERVER['argc'] = 2; + $_SERVER['argc'] = 2; + $_SERVER['REQUEST_URI'] = '/work'; $_SERVER['REQUEST_METHOD'] = 'POST'; @@ -161,12 +166,13 @@ public function testResourcePost() public function testResourcePatch() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', '123', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/123'; $_SERVER['REQUEST_METHOD'] = 'PATCH'; @@ -179,12 +185,13 @@ public function testResourcePatch() public function testResourcePut() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', '123', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/123'; $_SERVER['REQUEST_METHOD'] = 'PUT'; @@ -197,12 +204,13 @@ public function testResourcePut() public function testResourceDelete() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', '123', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/123'; $_SERVER['REQUEST_METHOD'] = 'DELETE'; diff --git a/tests/system/RESTful/ResourcePresenterTest.php b/tests/system/RESTful/ResourcePresenterTest.php index f33a316faf08..c01f932998cf 100644 --- a/tests/system/RESTful/ResourcePresenterTest.php +++ b/tests/system/RESTful/ResourcePresenterTest.php @@ -66,11 +66,12 @@ public function tearDown(): void public function testResourceGet() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', ]; - $_SERVER['argc'] = 2; + $_SERVER['argc'] = 2; + $_SERVER['REQUEST_URI'] = '/work'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -83,13 +84,14 @@ public function testResourceGet() public function testResourceShow() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'show', '1', ]; - $_SERVER['argc'] = 4; + $_SERVER['argc'] = 4; + $_SERVER['REQUEST_URI'] = '/work/show/1'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -102,12 +104,13 @@ public function testResourceShow() public function testResourceNew() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'new', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/new'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -120,12 +123,13 @@ public function testResourceNew() public function testResourceCreate() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'create', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/create'; $_SERVER['REQUEST_METHOD'] = 'POST'; @@ -138,13 +142,14 @@ public function testResourceCreate() public function testResourceRemove() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'remove', '123', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/remove/123'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -157,13 +162,14 @@ public function testResourceRemove() public function testResourceDelete() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'delete', '123', ]; - $_SERVER['argc'] = 3; + $_SERVER['argc'] = 3; + $_SERVER['REQUEST_URI'] = '/work/delete/123'; $_SERVER['REQUEST_METHOD'] = 'POST'; @@ -176,14 +182,15 @@ public function testResourceDelete() public function testResourceEdit() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'edit', '1', 'edit', ]; - $_SERVER['argc'] = 4; + $_SERVER['argc'] = 4; + $_SERVER['REQUEST_URI'] = '/work/edit/1'; $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -196,13 +203,14 @@ public function testResourceEdit() public function testResourceUpdate() { - $_SERVER['argv'] = [ + $_SERVER['argv'] = [ 'index.php', 'work', 'update', '123', ]; - $_SERVER['argc'] = 4; + $_SERVER['argc'] = 4; + $_SERVER['REQUEST_URI'] = '/work/update/123'; $_SERVER['REQUEST_METHOD'] = 'POST'; diff --git a/tests/system/Router/RouteCollectionTest.php b/tests/system/Router/RouteCollectionTest.php index 8c25b4cdc8ca..2ffe5069a75e 100644 --- a/tests/system/Router/RouteCollectionTest.php +++ b/tests/system/Router/RouteCollectionTest.php @@ -24,7 +24,7 @@ protected function getCollector(array $config = [], array $files = [], $moduleCo 'Config' => APPPATH . 'Config', 'App' => APPPATH, ]; - $config = array_merge($config, $defaults); + $config = array_merge($config, $defaults); Services::autoloader()->addNamespace($config); @@ -1054,7 +1054,7 @@ public function testAddRedirectNamed() $routes->addRedirect('users', 'namedRoute', 307); $expected = [ - 'users' => [ + 'users' => [ 'zombies' => '\Zombies::index', ], 'zombies' => '\Zombies::index', @@ -1073,7 +1073,7 @@ public function testAddRedirectGetMethod() $routes->addRedirect('users', 'namedRoute', 307); $expected = [ - 'users' => [ + 'users' => [ 'zombies' => '\Zombies::index', ], 'zombies' => '\Zombies::index', diff --git a/tests/system/Router/RouterTest.php b/tests/system/Router/RouterTest.php index e2a3ad9e352f..003a5509f3ba 100644 --- a/tests/system/Router/RouterTest.php +++ b/tests/system/Router/RouterTest.php @@ -37,15 +37,15 @@ protected function setUp(): void $this->collection = new RouteCollection(Services::locator(), $moduleConfig); $routes = [ - 'users' => 'Users::index', - 'user-setting/show-list' => 'User_setting::show_list', - 'user-setting/(:segment)' => 'User_setting::detail/$1', - 'posts' => 'Blog::posts', - 'pages' => 'App\Pages::list_all', - 'posts/(:num)' => 'Blog::show/$1', - 'posts/(:num)/edit' => 'Blog::edit/$1', - 'books/(:num)/(:alpha)/(:num)' => 'Blog::show/$3/$1', - 'closure/(:num)/(:alpha)' => static function ($num, $str) { + 'users' => 'Users::index', + 'user-setting/show-list' => 'User_setting::show_list', + 'user-setting/(:segment)' => 'User_setting::detail/$1', + 'posts' => 'Blog::posts', + 'pages' => 'App\Pages::list_all', + 'posts/(:num)' => 'Blog::show/$1', + 'posts/(:num)/edit' => 'Blog::edit/$1', + 'books/(:num)/(:alpha)/(:num)' => 'Blog::show/$3/$1', + 'closure/(:num)/(:alpha)' => static function ($num, $str) { return $num . '-' . $str; }, '{locale}/pages' => 'App\Pages::list_all', diff --git a/tests/system/Test/BootstrapFCPATHTest.php b/tests/system/Test/BootstrapFCPATHTest.php index 8a6cbd105e21..7fb62ca2c969 100644 --- a/tests/system/Test/BootstrapFCPATHTest.php +++ b/tests/system/Test/BootstrapFCPATHTest.php @@ -75,7 +75,7 @@ private function deleteFiles() : void private function fileContents() { - $fileContents = ''; + $fileContents = ''; $fileContents .= 'currentDir . "' . '/../../../');" . PHP_EOL; $fileContents .= "define('CONFIGPATH', '" . $this->currentDir . "' . '/../../../app/Config/');" . PHP_EOL; diff --git a/tests/system/Test/FeatureTestTraitTest.php b/tests/system/Test/FeatureTestTraitTest.php index 5dbd6ee2e546..929c54640747 100644 --- a/tests/system/Test/FeatureTestTraitTest.php +++ b/tests/system/Test/FeatureTestTraitTest.php @@ -260,17 +260,17 @@ public function testCallZeroAsPathGot404() public function provideRoutesData() { return [ - 'non parameterized cli' => [ + 'non parameterized cli' => [ 'hello', 'Hello::index', 'Hello', ], - 'parameterized cli' => [ + 'parameterized cli' => [ 'hello/(:any)', 'Hello::index/$1', 'Hello/index/samsonasik', ], - 'default method index' => [ + 'default method index' => [ 'hello', 'Hello', 'Hello', diff --git a/tests/system/Validation/CreditCardRulesTest.php b/tests/system/Validation/CreditCardRulesTest.php index b7a349929d70..5cd29c8db821 100644 --- a/tests/system/Validation/CreditCardRulesTest.php +++ b/tests/system/Validation/CreditCardRulesTest.php @@ -14,14 +14,14 @@ class CreditCardRulesTest extends CIUnitTestCase */ protected $validation; protected $config = [ - 'ruleSets' => [ + 'ruleSets' => [ Rules::class, FormatRules::class, FileRules::class, CreditCardRules::class, TestRules::class, ], - 'groupA' => [ + 'groupA' => [ 'foo' => 'required|min_length[5]', ], 'groupA_errors' => [ @@ -78,17 +78,17 @@ public function testValidCCNumber($type, $number, $expected = false) public function creditCardProvider() { return [ - 'null_test' => [ + 'null_test' => [ 'amex', null, false, ], - 'random_test' => [ + 'random_test' => [ 'amex', $this->generateCardNum('37', 16), false, ], - 'invalid_type' => [ + 'invalid_type' => [ 'shorty', '1111 1111 1111 1111', false, @@ -98,1112 +98,1112 @@ public function creditCardProvider() '', false, ], - 'not_numeric' => [ + 'not_numeric' => [ 'amex', 'abcd efgh ijkl mnop', false, ], - 'bad_length' => [ + 'bad_length' => [ 'amex', '3782 8224 6310 0051', false, ], - 'bad_prefix' => [ + 'bad_prefix' => [ 'amex', '3582 8224 6310 0051', false, ], - 'amex1' => [ + 'amex1' => [ 'amex', '3782 8224 6310 005', true, ], - 'amex2' => [ + 'amex2' => [ 'amex', '3714 4963 5398 431', true, ], - 'dinersclub1' => [ + 'dinersclub1' => [ 'dinersclub', '3056 9309 0259 04', true, ], - 'dinersculb2' => [ + 'dinersculb2' => [ 'dinersclub', '3852 0000 0232 37', true, ], - 'discover1' => [ + 'discover1' => [ 'discover', '6011 1111 1111 1117', true, ], - 'discover2' => [ + 'discover2' => [ 'discover', '6011 0009 9013 9424', true, ], - 'jcb1' => [ + 'jcb1' => [ 'jcb', '3530 1113 3330 0000', true, ], - 'jcb2' => [ + 'jcb2' => [ 'jcb', '3566 0020 2036 0505', true, ], - 'mastercard1' => [ + 'mastercard1' => [ 'mastercard', '5555 5555 5555 4444', true, ], - 'mastercard2' => [ + 'mastercard2' => [ 'mastercard', '5105 1051 0510 5100', true, ], - 'visa1' => [ + 'visa1' => [ 'visa', '4111 1111 1111 1111', true, ], - 'visa2' => [ + 'visa2' => [ 'visa', '4012 8888 8888 1881', true, ], - 'visa3' => [ + 'visa3' => [ 'visa', '4222 2222 2222 2', true, ], - 'dankort1' => [ + 'dankort1' => [ 'dankort', '5019 7170 1010 3742', true, ], - 'unionpay1' => [ + 'unionpay1' => [ 'unionpay', $this->generateCardNum(62, 16), true, ], - 'unionpay2' => [ + 'unionpay2' => [ 'unionpay', $this->generateCardNum(62, 17), true, ], - 'unionpay3' => [ + 'unionpay3' => [ 'unionpay', $this->generateCardNum(62, 18), true, ], - 'unionpay4' => [ + 'unionpay4' => [ 'unionpay', $this->generateCardNum(62, 19), true, ], - 'unionpay5' => [ + 'unionpay5' => [ 'unionpay', $this->generateCardNum(63, 19), false, ], - 'carteblanche1' => [ + 'carteblanche1' => [ 'carteblanche', $this->generateCardNum(300, 14), true, ], - 'carteblanche2' => [ + 'carteblanche2' => [ 'carteblanche', $this->generateCardNum(301, 14), true, ], - 'carteblanche3' => [ + 'carteblanche3' => [ 'carteblanche', $this->generateCardNum(302, 14), true, ], - 'carteblanche4' => [ + 'carteblanche4' => [ 'carteblanche', $this->generateCardNum(303, 14), true, ], - 'carteblanche5' => [ + 'carteblanche5' => [ 'carteblanche', $this->generateCardNum(304, 14), true, ], - 'carteblanche6' => [ + 'carteblanche6' => [ 'carteblanche', $this->generateCardNum(305, 14), true, ], - 'carteblanche7' => [ + 'carteblanche7' => [ 'carteblanche', $this->generateCardNum(306, 14), false, ], - 'dinersclub3' => [ + 'dinersclub3' => [ 'dinersclub', $this->generateCardNum(300, 14), true, ], - 'dinersclub4' => [ + 'dinersclub4' => [ 'dinersclub', $this->generateCardNum(301, 14), true, ], - 'dinersclub5' => [ + 'dinersclub5' => [ 'dinersclub', $this->generateCardNum(302, 14), true, ], - 'dinersclub6' => [ + 'dinersclub6' => [ 'dinersclub', $this->generateCardNum(303, 14), true, ], - 'dinersclub7' => [ + 'dinersclub7' => [ 'dinersclub', $this->generateCardNum(304, 14), true, ], - 'dinersclub8' => [ + 'dinersclub8' => [ 'dinersclub', $this->generateCardNum(305, 14), true, ], - 'dinersclub9' => [ + 'dinersclub9' => [ 'dinersclub', $this->generateCardNum(309, 14), true, ], - 'dinersclub10' => [ + 'dinersclub10' => [ 'dinersclub', $this->generateCardNum(36, 14), true, ], - 'dinersclub11' => [ + 'dinersclub11' => [ 'dinersclub', $this->generateCardNum(38, 14), true, ], - 'dinersclub12' => [ + 'dinersclub12' => [ 'dinersclub', $this->generateCardNum(39, 14), true, ], - 'dinersclub13' => [ + 'dinersclub13' => [ 'dinersclub', $this->generateCardNum(54, 14), true, ], - 'dinersclub14' => [ + 'dinersclub14' => [ 'dinersclub', $this->generateCardNum(55, 14), true, ], - 'dinersclub15' => [ + 'dinersclub15' => [ 'dinersclub', $this->generateCardNum(300, 16), true, ], - 'dinersclub16' => [ + 'dinersclub16' => [ 'dinersclub', $this->generateCardNum(301, 16), true, ], - 'dinersclub17' => [ + 'dinersclub17' => [ 'dinersclub', $this->generateCardNum(302, 16), true, ], - 'dinersclub18' => [ + 'dinersclub18' => [ 'dinersclub', $this->generateCardNum(303, 16), true, ], - 'dinersclub19' => [ + 'dinersclub19' => [ 'dinersclub', $this->generateCardNum(304, 16), true, ], - 'dinersclub20' => [ + 'dinersclub20' => [ 'dinersclub', $this->generateCardNum(305, 16), true, ], - 'dinersclub21' => [ + 'dinersclub21' => [ 'dinersclub', $this->generateCardNum(309, 16), true, ], - 'dinersclub22' => [ + 'dinersclub22' => [ 'dinersclub', $this->generateCardNum(36, 16), true, ], - 'dinersclub23' => [ + 'dinersclub23' => [ 'dinersclub', $this->generateCardNum(38, 16), true, ], - 'dinersclub24' => [ + 'dinersclub24' => [ 'dinersclub', $this->generateCardNum(39, 16), true, ], - 'dinersclub25' => [ + 'dinersclub25' => [ 'dinersclub', $this->generateCardNum(54, 16), true, ], - 'dinersclub26' => [ + 'dinersclub26' => [ 'dinersclub', $this->generateCardNum(55, 16), true, ], - 'discover3' => [ + 'discover3' => [ 'discover', $this->generateCardNum(6011, 16), true, ], - 'discover4' => [ + 'discover4' => [ 'discover', $this->generateCardNum(622, 16), true, ], - 'discover5' => [ + 'discover5' => [ 'discover', $this->generateCardNum(644, 16), true, ], - 'discover6' => [ + 'discover6' => [ 'discover', $this->generateCardNum(645, 16), true, ], - 'discover7' => [ + 'discover7' => [ 'discover', $this->generateCardNum(656, 16), true, ], - 'discover8' => [ + 'discover8' => [ 'discover', $this->generateCardNum(647, 16), true, ], - 'discover9' => [ + 'discover9' => [ 'discover', $this->generateCardNum(648, 16), true, ], - 'discover10' => [ + 'discover10' => [ 'discover', $this->generateCardNum(649, 16), true, ], - 'discover11' => [ + 'discover11' => [ 'discover', $this->generateCardNum(65, 16), true, ], - 'discover12' => [ + 'discover12' => [ 'discover', $this->generateCardNum(6011, 19), true, ], - 'discover13' => [ + 'discover13' => [ 'discover', $this->generateCardNum(622, 19), true, ], - 'discover14' => [ + 'discover14' => [ 'discover', $this->generateCardNum(644, 19), true, ], - 'discover15' => [ + 'discover15' => [ 'discover', $this->generateCardNum(645, 19), true, ], - 'discover16' => [ + 'discover16' => [ 'discover', $this->generateCardNum(656, 19), true, ], - 'discover17' => [ + 'discover17' => [ 'discover', $this->generateCardNum(647, 19), true, ], - 'discover18' => [ + 'discover18' => [ 'discover', $this->generateCardNum(648, 19), true, ], - 'discover19' => [ + 'discover19' => [ 'discover', $this->generateCardNum(649, 19), true, ], - 'discover20' => [ + 'discover20' => [ 'discover', $this->generateCardNum(65, 19), true, ], - 'interpayment1' => [ + 'interpayment1' => [ 'interpayment', $this->generateCardNum(4, 16), true, ], - 'interpayment2' => [ + 'interpayment2' => [ 'interpayment', $this->generateCardNum(4, 17), true, ], - 'interpayment3' => [ + 'interpayment3' => [ 'interpayment', $this->generateCardNum(4, 18), true, ], - 'interpayment4' => [ + 'interpayment4' => [ 'interpayment', $this->generateCardNum(4, 19), true, ], - 'jcb1' => [ + 'jcb1' => [ 'jcb', $this->generateCardNum(352, 16), true, ], - 'jcb2' => [ + 'jcb2' => [ 'jcb', $this->generateCardNum(353, 16), true, ], - 'jcb3' => [ + 'jcb3' => [ 'jcb', $this->generateCardNum(354, 16), true, ], - 'jcb4' => [ + 'jcb4' => [ 'jcb', $this->generateCardNum(355, 16), true, ], - 'jcb5' => [ + 'jcb5' => [ 'jcb', $this->generateCardNum(356, 16), true, ], - 'jcb6' => [ + 'jcb6' => [ 'jcb', $this->generateCardNum(357, 16), true, ], - 'jcb7' => [ + 'jcb7' => [ 'jcb', $this->generateCardNum(358, 16), true, ], - 'maestro1' => [ + 'maestro1' => [ 'maestro', $this->generateCardNum(50, 12), true, ], - 'maestro2' => [ + 'maestro2' => [ 'maestro', $this->generateCardNum(56, 12), true, ], - 'maestro3' => [ + 'maestro3' => [ 'maestro', $this->generateCardNum(57, 12), true, ], - 'maestro4' => [ + 'maestro4' => [ 'maestro', $this->generateCardNum(58, 12), true, ], - 'maestro5' => [ + 'maestro5' => [ 'maestro', $this->generateCardNum(59, 12), true, ], - 'maestro6' => [ + 'maestro6' => [ 'maestro', $this->generateCardNum(60, 12), true, ], - 'maestro7' => [ + 'maestro7' => [ 'maestro', $this->generateCardNum(61, 12), true, ], - 'maestro8' => [ + 'maestro8' => [ 'maestro', $this->generateCardNum(62, 12), true, ], - 'maestro9' => [ + 'maestro9' => [ 'maestro', $this->generateCardNum(63, 12), true, ], - 'maestro10' => [ + 'maestro10' => [ 'maestro', $this->generateCardNum(64, 12), true, ], - 'maestro11' => [ + 'maestro11' => [ 'maestro', $this->generateCardNum(65, 12), true, ], - 'maestro12' => [ + 'maestro12' => [ 'maestro', $this->generateCardNum(66, 12), true, ], - 'maestro13' => [ + 'maestro13' => [ 'maestro', $this->generateCardNum(67, 12), true, ], - 'maestro14' => [ + 'maestro14' => [ 'maestro', $this->generateCardNum(68, 12), true, ], - 'maestro15' => [ + 'maestro15' => [ 'maestro', $this->generateCardNum(69, 12), true, ], - 'maestro16' => [ + 'maestro16' => [ 'maestro', $this->generateCardNum(50, 13), true, ], - 'maestro17' => [ + 'maestro17' => [ 'maestro', $this->generateCardNum(56, 13), true, ], - 'maestro18' => [ + 'maestro18' => [ 'maestro', $this->generateCardNum(57, 13), true, ], - 'maestro19' => [ + 'maestro19' => [ 'maestro', $this->generateCardNum(58, 13), true, ], - 'maestro20' => [ + 'maestro20' => [ 'maestro', $this->generateCardNum(59, 13), true, ], - 'maestro21' => [ + 'maestro21' => [ 'maestro', $this->generateCardNum(60, 13), true, ], - 'maestro22' => [ + 'maestro22' => [ 'maestro', $this->generateCardNum(61, 13), true, ], - 'maestro23' => [ + 'maestro23' => [ 'maestro', $this->generateCardNum(62, 13), true, ], - 'maestro24' => [ + 'maestro24' => [ 'maestro', $this->generateCardNum(63, 13), true, ], - 'maestro25' => [ + 'maestro25' => [ 'maestro', $this->generateCardNum(64, 13), true, ], - 'maestro26' => [ + 'maestro26' => [ 'maestro', $this->generateCardNum(65, 13), true, ], - 'maestro27' => [ + 'maestro27' => [ 'maestro', $this->generateCardNum(66, 13), true, ], - 'maestro28' => [ + 'maestro28' => [ 'maestro', $this->generateCardNum(67, 13), true, ], - 'maestro29' => [ + 'maestro29' => [ 'maestro', $this->generateCardNum(68, 13), true, ], - 'maestro30' => [ + 'maestro30' => [ 'maestro', $this->generateCardNum(69, 13), true, ], - 'maestro31' => [ + 'maestro31' => [ 'maestro', $this->generateCardNum(50, 14), true, ], - 'maestro32' => [ + 'maestro32' => [ 'maestro', $this->generateCardNum(56, 14), true, ], - 'maestro33' => [ + 'maestro33' => [ 'maestro', $this->generateCardNum(57, 14), true, ], - 'maestro34' => [ + 'maestro34' => [ 'maestro', $this->generateCardNum(58, 14), true, ], - 'maestro35' => [ + 'maestro35' => [ 'maestro', $this->generateCardNum(59, 14), true, ], - 'maestro36' => [ + 'maestro36' => [ 'maestro', $this->generateCardNum(60, 14), true, ], - 'maestro37' => [ + 'maestro37' => [ 'maestro', $this->generateCardNum(61, 14), true, ], - 'maestro38' => [ + 'maestro38' => [ 'maestro', $this->generateCardNum(62, 14), true, ], - 'maestro39' => [ + 'maestro39' => [ 'maestro', $this->generateCardNum(63, 14), true, ], - 'maestro40' => [ + 'maestro40' => [ 'maestro', $this->generateCardNum(64, 14), true, ], - 'maestro41' => [ + 'maestro41' => [ 'maestro', $this->generateCardNum(65, 14), true, ], - 'maestro42' => [ + 'maestro42' => [ 'maestro', $this->generateCardNum(66, 14), true, ], - 'maestro43' => [ + 'maestro43' => [ 'maestro', $this->generateCardNum(67, 14), true, ], - 'maestro44' => [ + 'maestro44' => [ 'maestro', $this->generateCardNum(68, 14), true, ], - 'maestro45' => [ + 'maestro45' => [ 'maestro', $this->generateCardNum(69, 14), true, ], - 'maestro46' => [ + 'maestro46' => [ 'maestro', $this->generateCardNum(50, 15), true, ], - 'maestro47' => [ + 'maestro47' => [ 'maestro', $this->generateCardNum(56, 15), true, ], - 'maestro48' => [ + 'maestro48' => [ 'maestro', $this->generateCardNum(57, 15), true, ], - 'maestro49' => [ + 'maestro49' => [ 'maestro', $this->generateCardNum(58, 15), true, ], - 'maestro50' => [ + 'maestro50' => [ 'maestro', $this->generateCardNum(59, 15), true, ], - 'maestro51' => [ + 'maestro51' => [ 'maestro', $this->generateCardNum(60, 15), true, ], - 'maestro52' => [ + 'maestro52' => [ 'maestro', $this->generateCardNum(61, 15), true, ], - 'maestro53' => [ + 'maestro53' => [ 'maestro', $this->generateCardNum(62, 15), true, ], - 'maestro54' => [ + 'maestro54' => [ 'maestro', $this->generateCardNum(63, 15), true, ], - 'maestro55' => [ + 'maestro55' => [ 'maestro', $this->generateCardNum(64, 15), true, ], - 'maestro56' => [ + 'maestro56' => [ 'maestro', $this->generateCardNum(65, 15), true, ], - 'maestro57' => [ + 'maestro57' => [ 'maestro', $this->generateCardNum(66, 15), true, ], - 'maestro58' => [ + 'maestro58' => [ 'maestro', $this->generateCardNum(67, 15), true, ], - 'maestro59' => [ + 'maestro59' => [ 'maestro', $this->generateCardNum(68, 15), true, ], - 'maestro60' => [ + 'maestro60' => [ 'maestro', $this->generateCardNum(69, 15), true, ], - 'maestro61' => [ + 'maestro61' => [ 'maestro', $this->generateCardNum(50, 16), true, ], - 'maestro62' => [ + 'maestro62' => [ 'maestro', $this->generateCardNum(56, 16), true, ], - 'maestro63' => [ + 'maestro63' => [ 'maestro', $this->generateCardNum(57, 16), true, ], - 'maestro64' => [ + 'maestro64' => [ 'maestro', $this->generateCardNum(58, 16), true, ], - 'maestro65' => [ + 'maestro65' => [ 'maestro', $this->generateCardNum(59, 16), true, ], - 'maestro66' => [ + 'maestro66' => [ 'maestro', $this->generateCardNum(60, 16), true, ], - 'maestro67' => [ + 'maestro67' => [ 'maestro', $this->generateCardNum(61, 16), true, ], - 'maestro68' => [ + 'maestro68' => [ 'maestro', $this->generateCardNum(62, 16), true, ], - 'maestro69' => [ + 'maestro69' => [ 'maestro', $this->generateCardNum(63, 16), true, ], - 'maestro70' => [ + 'maestro70' => [ 'maestro', $this->generateCardNum(64, 16), true, ], - 'maestro71' => [ + 'maestro71' => [ 'maestro', $this->generateCardNum(65, 16), true, ], - 'maestro72' => [ + 'maestro72' => [ 'maestro', $this->generateCardNum(66, 16), true, ], - 'maestro73' => [ + 'maestro73' => [ 'maestro', $this->generateCardNum(67, 16), true, ], - 'maestro74' => [ + 'maestro74' => [ 'maestro', $this->generateCardNum(68, 16), true, ], - 'maestro75' => [ + 'maestro75' => [ 'maestro', $this->generateCardNum(69, 16), true, ], - 'maestro91' => [ + 'maestro91' => [ 'maestro', $this->generateCardNum(50, 18), true, ], - 'maestro92' => [ + 'maestro92' => [ 'maestro', $this->generateCardNum(56, 18), true, ], - 'maestro93' => [ + 'maestro93' => [ 'maestro', $this->generateCardNum(57, 18), true, ], - 'maestro94' => [ + 'maestro94' => [ 'maestro', $this->generateCardNum(58, 18), true, ], - 'maestro95' => [ + 'maestro95' => [ 'maestro', $this->generateCardNum(59, 18), true, ], - 'maestro96' => [ + 'maestro96' => [ 'maestro', $this->generateCardNum(60, 18), true, ], - 'maestro97' => [ + 'maestro97' => [ 'maestro', $this->generateCardNum(61, 18), true, ], - 'maestro98' => [ + 'maestro98' => [ 'maestro', $this->generateCardNum(62, 18), true, ], - 'maestro99' => [ + 'maestro99' => [ 'maestro', $this->generateCardNum(63, 18), true, ], - 'maestro100' => [ + 'maestro100' => [ 'maestro', $this->generateCardNum(64, 18), true, ], - 'maestro101' => [ + 'maestro101' => [ 'maestro', $this->generateCardNum(65, 18), true, ], - 'maestro102' => [ + 'maestro102' => [ 'maestro', $this->generateCardNum(66, 18), true, ], - 'maestro103' => [ + 'maestro103' => [ 'maestro', $this->generateCardNum(67, 18), true, ], - 'maestro104' => [ + 'maestro104' => [ 'maestro', $this->generateCardNum(68, 18), true, ], - 'maestro105' => [ + 'maestro105' => [ 'maestro', $this->generateCardNum(69, 18), true, ], - 'maestro106' => [ + 'maestro106' => [ 'maestro', $this->generateCardNum(50, 19), true, ], - 'maestro107' => [ + 'maestro107' => [ 'maestro', $this->generateCardNum(56, 19), true, ], - 'maestro108' => [ + 'maestro108' => [ 'maestro', $this->generateCardNum(57, 19), true, ], - 'maestro109' => [ + 'maestro109' => [ 'maestro', $this->generateCardNum(58, 19), true, ], - 'maestro110' => [ + 'maestro110' => [ 'maestro', $this->generateCardNum(59, 19), true, ], - 'maestro111' => [ + 'maestro111' => [ 'maestro', $this->generateCardNum(60, 19), true, ], - 'maestro112' => [ + 'maestro112' => [ 'maestro', $this->generateCardNum(61, 19), true, ], - 'maestro113' => [ + 'maestro113' => [ 'maestro', $this->generateCardNum(62, 19), true, ], - 'maestro114' => [ + 'maestro114' => [ 'maestro', $this->generateCardNum(63, 19), true, ], - 'maestro115' => [ + 'maestro115' => [ 'maestro', $this->generateCardNum(64, 19), true, ], - 'maestro116' => [ + 'maestro116' => [ 'maestro', $this->generateCardNum(65, 19), true, ], - 'maestro117' => [ + 'maestro117' => [ 'maestro', $this->generateCardNum(66, 19), true, ], - 'maestro118' => [ + 'maestro118' => [ 'maestro', $this->generateCardNum(67, 19), true, ], - 'maestro119' => [ + 'maestro119' => [ 'maestro', $this->generateCardNum(68, 19), true, ], - 'maestro120' => [ + 'maestro120' => [ 'maestro', $this->generateCardNum(69, 19), true, ], - 'dankort1' => [ + 'dankort1' => [ 'dankort', $this->generateCardNum(5019, 16), true, ], - 'dankort2' => [ + 'dankort2' => [ 'dankort', $this->generateCardNum(4175, 16), true, ], - 'dankort3' => [ + 'dankort3' => [ 'dankort', $this->generateCardNum(4571, 16), true, ], - 'dankort4' => [ + 'dankort4' => [ 'dankort', $this->generateCardNum(4, 16), true, ], - 'mir1' => [ + 'mir1' => [ 'mir', $this->generateCardNum(2200, 16), true, ], - 'mir2' => [ + 'mir2' => [ 'mir', $this->generateCardNum(2201, 16), true, ], - 'mir3' => [ + 'mir3' => [ 'mir', $this->generateCardNum(2202, 16), true, ], - 'mir4' => [ + 'mir4' => [ 'mir', $this->generateCardNum(2203, 16), true, ], - 'mir5' => [ + 'mir5' => [ 'mir', $this->generateCardNum(2204, 16), true, ], - 'mastercard1' => [ + 'mastercard1' => [ 'mastercard', $this->generateCardNum(51, 16), true, ], - 'mastercard2' => [ + 'mastercard2' => [ 'mastercard', $this->generateCardNum(52, 16), true, ], - 'mastercard3' => [ + 'mastercard3' => [ 'mastercard', $this->generateCardNum(53, 16), true, ], - 'mastercard4' => [ + 'mastercard4' => [ 'mastercard', $this->generateCardNum(54, 16), true, ], - 'mastercard5' => [ + 'mastercard5' => [ 'mastercard', $this->generateCardNum(55, 16), true, ], - 'mastercard6' => [ + 'mastercard6' => [ 'mastercard', $this->generateCardNum(22, 16), true, ], - 'mastercard7' => [ + 'mastercard7' => [ 'mastercard', $this->generateCardNum(23, 16), true, ], - 'mastercard8' => [ + 'mastercard8' => [ 'mastercard', $this->generateCardNum(24, 16), true, ], - 'mastercard9' => [ + 'mastercard9' => [ 'mastercard', $this->generateCardNum(25, 16), true, ], - 'mastercard10' => [ + 'mastercard10' => [ 'mastercard', $this->generateCardNum(26, 16), true, ], - 'mastercard11' => [ + 'mastercard11' => [ 'mastercard', $this->generateCardNum(27, 16), true, ], - 'visa1' => [ + 'visa1' => [ 'visa', $this->generateCardNum(4, 13), true, ], - 'visa2' => [ + 'visa2' => [ 'visa', $this->generateCardNum(4, 16), true, ], - 'visa3' => [ + 'visa3' => [ 'visa', $this->generateCardNum(4, 19), true, ], - 'uatp' => [ + 'uatp' => [ 'uatp', $this->generateCardNum(1, 15), true, ], - 'verve1' => [ + 'verve1' => [ 'verve', $this->generateCardNum(506, 16), true, ], - 'verve2' => [ + 'verve2' => [ 'verve', $this->generateCardNum(650, 16), true, ], - 'verve3' => [ + 'verve3' => [ 'verve', $this->generateCardNum(506, 19), true, ], - 'verve4' => [ + 'verve4' => [ 'verve', $this->generateCardNum(650, 19), true, ], - 'cibc1' => [ + 'cibc1' => [ 'cibc', $this->generateCardNum(4506, 16), true, ], - 'rbc1' => [ + 'rbc1' => [ 'rbc', $this->generateCardNum(45, 16), true, ], - 'tdtrust' => [ + 'tdtrust' => [ 'tdtrust', $this->generateCardNum(589297, 16), true, ], - 'scotia1' => [ + 'scotia1' => [ 'scotia', $this->generateCardNum(4536, 16), true, ], - 'bmoabm1' => [ + 'bmoabm1' => [ 'bmoabm', $this->generateCardNum(500, 16), true, ], - 'hsbc' => [ + 'hsbc' => [ 'hsbc', $this->generateCardNum(56, 16), true, ], - 'hsbc' => [ + 'hsbc' => [ 'hsbc', $this->generateCardNum(57, 16), false, diff --git a/tests/system/Validation/FileRulesTest.php b/tests/system/Validation/FileRulesTest.php index d06a35072ec1..5252a57b2863 100644 --- a/tests/system/Validation/FileRulesTest.php +++ b/tests/system/Validation/FileRulesTest.php @@ -14,14 +14,14 @@ class FileRulesTest extends CIUnitTestCase */ protected $validation; protected $config = [ - 'ruleSets' => [ + 'ruleSets' => [ Rules::class, FormatRules::class, FileRules::class, CreditCardRules::class, TestRules::class, ], - 'groupA' => [ + 'groupA' => [ 'foo' => 'required|min_length[5]', ], 'groupA_errors' => [ @@ -40,7 +40,7 @@ protected function setUp(): void $this->validation->reset(); $_FILES = [ - 'avatar' => [ + 'avatar' => [ 'tmp_name' => TESTPATH . '_support/Validation/uploads/phpUxc0ty', 'name' => 'my-avatar.png', 'size' => 4614, @@ -58,7 +58,7 @@ protected function setUp(): void 'width' => 640, 'height' => 400, ], - 'photo' => [ + 'photo' => [ 'tmp_name' => TESTPATH . '_support/Validation/uploads/phpUxc0ty', 'name' => 'my-photo.png', 'size' => 4614, @@ -67,62 +67,62 @@ protected function setUp(): void 'width' => 640, 'height' => 400, ], - 'images' => [ + 'images' => [ 'tmp_name' => [ TESTPATH . '_support/Validation/uploads/phpUxc0ty', TESTPATH . '_support/Validation/uploads/phpUxc0ty', ], - 'name' => [ + 'name' => [ 'my_avatar.png', 'my_bigfile.png', ], - 'size' => [ + 'size' => [ 4614, 1024000, ], - 'type' => [ + 'type' => [ 'image/png', 'image/png', ], - 'error' => [ + 'error' => [ 0, 0, ], - 'width' => [ + 'width' => [ 640, 640, ], - 'height' => [ + 'height' => [ 400, 400, ], ], - 'photos' => [ + 'photos' => [ 'tmp_name' => [ TESTPATH . '_support/Validation/uploads/phpUxc0ty', TESTPATH . '_support/Validation/uploads/phpUxc0ty', ], - 'name' => [ + 'name' => [ 'my_avatar.png', 'my_bigfile.png', ], - 'size' => [ + 'size' => [ 4614, 1024000, ], - 'type' => [ + 'type' => [ 'image/png', 'image/png', ], - 'error' => [ + 'error' => [ 1, 0, ], - 'width' => [ + 'width' => [ 640, 640, ], - 'height' => [ + 'height' => [ 400, 400, ], diff --git a/tests/system/Validation/FormatRulesTest.php b/tests/system/Validation/FormatRulesTest.php index 81547ce52bca..f9b5391f77d2 100644 --- a/tests/system/Validation/FormatRulesTest.php +++ b/tests/system/Validation/FormatRulesTest.php @@ -16,14 +16,14 @@ class FormatRulesTest extends CIUnitTestCase */ protected $validation; protected $config = [ - 'ruleSets' => [ + 'ruleSets' => [ Rules::class, FormatRules::class, FileRules::class, CreditCardRules::class, TestRules::class, ], - 'groupA' => [ + 'groupA' => [ 'foo' => 'required|min_length[5]', ], 'groupA_errors' => [ diff --git a/tests/system/Validation/RulesTest.php b/tests/system/Validation/RulesTest.php index 2efb22b3c797..fb92252dbd12 100644 --- a/tests/system/Validation/RulesTest.php +++ b/tests/system/Validation/RulesTest.php @@ -20,14 +20,14 @@ class RulesTest extends CIUnitTestCase */ protected $validation; protected $config = [ - 'ruleSets' => [ + 'ruleSets' => [ Rules::class, FormatRules::class, FileRules::class, CreditCardRules::class, TestRules::class, ], - 'groupA' => [ + 'groupA' => [ 'foo' => 'required|min_length[5]', ], 'groupA_errors' => [ @@ -740,7 +740,7 @@ public function testIsUniqueIgnoresParams() 'email' => 'deva@example.com', 'country' => 'Elbonia', ]); - $row = $db->table('user') + $row = $db->table('user') ->limit(1) ->get() ->getRow(); @@ -871,7 +871,7 @@ public function testIsNotUniqueIgnoresParams() 'email' => 'deva@example.com', 'country' => 'Elbonia', ]); - $row = $db->table('user') + $row = $db->table('user') ->limit(1) ->get() ->getRow(); diff --git a/tests/system/Validation/ValidationTest.php b/tests/system/Validation/ValidationTest.php index e936c4036b86..8883e55a4d27 100644 --- a/tests/system/Validation/ValidationTest.php +++ b/tests/system/Validation/ValidationTest.php @@ -21,17 +21,17 @@ final class ValidationTest extends CIUnitTestCase */ protected $validation; protected $config = [ - 'ruleSets' => [ + 'ruleSets' => [ Rules::class, FormatRules::class, FileRules::class, CreditCardRules::class, TestRules::class, ], - 'groupA' => [ + 'groupA' => [ 'foo' => 'required|min_length[5]', ], - 'login' => [ + 'login' => [ 'username' => [ 'label' => 'Username', 'rules' => 'required', @@ -52,8 +52,8 @@ final class ValidationTest extends CIUnitTestCase 'min_length' => 'Shame, shame. Too short.', ], ], - 'groupX' => 'Not an array, so not a real group', - 'templates' => [ + 'groupX' => 'Not an array, so not a real group', + 'templates' => [ 'list' => 'CodeIgniter\Validation\Views\list', 'single' => 'CodeIgniter\Validation\Views\single', ], @@ -477,7 +477,7 @@ public function testJsonInput() $request = new IncomingRequest($config, new URI(), $json, new UserAgent()); - $rules = [ + $rules = [ 'role' => 'required|min_length[5]', ]; $validated = $this->validation @@ -715,30 +715,30 @@ public function testRulesForArrayField($body, $rules, $results) public function arrayFieldDataProvider() { return [ - 'all_rules_should_pass' => [ - 'body' => [ + 'all_rules_should_pass' => [ + 'body' => [ 'foo' => [ 'a', 'b', 'c', ], ], - 'rules' => [ + 'rules' => [ 'foo.0' => 'required|alpha|max_length[2]', 'foo.1' => 'required|alpha|max_length[2]', 'foo.2' => 'required|alpha|max_length[2]', ], 'results' => [], ], - 'first_field_will_return_required_error' => [ - 'body' => [ + 'first_field_will_return_required_error' => [ + 'body' => [ 'foo' => [ '', 'b', 'c', ], ], - 'rules' => [ + 'rules' => [ 'foo.0' => 'required|alpha|max_length[2]', 'foo.1' => 'required|alpha|max_length[2]', 'foo.2' => 'required|alpha|max_length[2]', @@ -748,14 +748,14 @@ public function arrayFieldDataProvider() ], ], 'first_and second_field_will_return_required_and_min_length_error' => [ - 'body' => [ + 'body' => [ 'foo' => [ '', 'b', 'c', ], ], - 'rules' => [ + 'rules' => [ 'foo.0' => 'required|alpha|max_length[2]', 'foo.1' => 'required|alpha|min_length[2]|max_length[4]', 'foo.2' => 'required|alpha|max_length[2]', @@ -776,7 +776,7 @@ public function testRulesForSingleRuleWithAsteriskWillReturnNoError() $config->baseURL = 'http://example.com/'; $_REQUEST = [ - 'id_user' => [ + 'id_user' => [ 1, 3, ], @@ -805,7 +805,7 @@ public function testRulesForSingleRuleWithAsteriskWillReturnError() $config->baseURL = 'http://example.com/'; $_REQUEST = [ - 'id_user' => [ + 'id_user' => [ '1dfd', 3, ], @@ -982,7 +982,7 @@ public function dotNotationForIfExistProvider() yield 'dot-on-middle-fail' => [ false, ['fizz.*.baz' => 'if_exist|numeric'], - ['fizz' => [ + ['fizz' => [ 'bar' => ['baz' => 'yes'], ]], ]; @@ -990,7 +990,7 @@ public function dotNotationForIfExistProvider() yield 'dot-on-middle-pass' => [ true, ['fizz.*.baz' => 'if_exist|numeric'], - ['fizz' => [ + ['fizz' => [ 'bar' => ['baz' => 30], ]], ]; diff --git a/tests/system/View/CellTest.php b/tests/system/View/CellTest.php index cf790bbcec57..378084685c09 100644 --- a/tests/system/View/CellTest.php +++ b/tests/system/View/CellTest.php @@ -253,7 +253,7 @@ public function testRenderCachedAutoName() public function testParametersMatch() { - $params = [ + $params = [ 'p1' => 'one', 'p2' => 'two', 'p4' => 'three', diff --git a/tests/system/View/ParserFilterTest.php b/tests/system/View/ParserFilterTest.php index cbe69e500fd9..c8a5a387ac41 100644 --- a/tests/system/View/ParserFilterTest.php +++ b/tests/system/View/ParserFilterTest.php @@ -432,7 +432,7 @@ public function testParsePairWithAbs() 'svalue2' => 2, ], ], - 'loop' => [ + 'loop' => [ [ 'lvalue' => -3, ], @@ -450,7 +450,7 @@ public function testParsePairWithAbs() 'nsvalue2' => 5, ], ], - 'nsloop' => [ + 'nsloop' => [ [ 'nlvalue' => -6, ], diff --git a/tests/system/View/ParserTest.php b/tests/system/View/ParserTest.php index 4eee10e3bae3..b37e558af7da 100644 --- a/tests/system/View/ParserTest.php +++ b/tests/system/View/ParserTest.php @@ -358,9 +358,9 @@ public function testMismatchedVarPair() public function escValueTypes() { return [ - 'scalar' => [42], - 'string' => ['George'], - 'scalarlist' => [ + 'scalar' => [42], + 'string' => ['George'], + 'scalarlist' => [ [ 1, 2, @@ -368,7 +368,7 @@ public function escValueTypes() -4, ], ], - 'stringlist' => [ + 'stringlist' => [ [ 'George', 'Paul', @@ -382,7 +382,7 @@ public function escValueTypes() 'role' => 'guitar', ], ], - 'compound' => [ + 'compound' => [ [ 'name' => 'George', 'address' => [ @@ -391,7 +391,7 @@ public function escValueTypes() ], ], ], - 'pseudo' => [ + 'pseudo' => [ [ 'name' => 'George', 'emails' => [ @@ -777,7 +777,7 @@ public function testParserPluginClosure() public function testParserPluginParams() { $this->parser->addPlugin('growth', static function ($str, array $params) { - $step = $params['step'] ?? 1; + $step = $params['step'] ?? 1; $count = $params['count'] ?? 2; $out = ''; diff --git a/utils/PhpCsFixer/CodeIgniter4.php b/utils/PhpCsFixer/CodeIgniter4.php index e55d8670229e..28d1eaf066b2 100644 --- a/utils/PhpCsFixer/CodeIgniter4.php +++ b/utils/PhpCsFixer/CodeIgniter4.php @@ -26,10 +26,10 @@ public function __construct() 'binary_operator_spaces' => [ 'default' => 'single_space', 'operators' => [ - '=' => 'align_single_space', - '=>' => 'align_single_space', - '||' => 'align_single_space', - '.=' => 'align_single_space', + '=' => 'align_single_space_minimal', + '=>' => 'align_single_space_minimal', + '||' => 'align_single_space_minimal', + '.=' => 'align_single_space_minimal', ], ], 'blank_line_after_namespace' => true, @@ -61,15 +61,13 @@ public function __construct() 'position_after_control_structures' => 'same', 'position_after_functions_and_oop_constructs' => 'next', ], - 'cast_spaces' => ['space' => 'single'], - 'function_to_constant' => true, - 'indentation_type' => true, - 'line_ending' => true, - 'no_alias_functions' => [ - 'sets' => ['@all'], - ], - 'phpdoc_align' => true, - 'phpdoc_scalar' => [ + 'cast_spaces' => ['space' => 'single'], + 'function_to_constant' => true, + 'indentation_type' => true, + 'line_ending' => true, + 'no_alias_functions' => ['sets' => ['@all']], + 'phpdoc_align' => true, + 'phpdoc_scalar' => [ 'types' => [ 'boolean', 'callback', @@ -79,10 +77,10 @@ public function __construct() 'str', ], ], - 'phpdoc_separation' => true, - 'static_lambda' => true, - 'ternary_to_null_coalescing' => true, - 'yoda_style' => [ + 'phpdoc_separation' => true, + 'static_lambda' => true, + 'ternary_to_null_coalescing' => true, + 'yoda_style' => [ 'equal' => false, 'identical' => null, 'less_and_greater' => false,