From 9514f4d0c96d84fd7a86047e2ad95b4aa858330f Mon Sep 17 00:00:00 2001 From: Logan Gray Date: Tue, 6 Mar 2018 19:16:41 -0500 Subject: [PATCH 1/6] from -> form - and giving - meaning given (simple grammar) --- src/Commands/CreateFormViewCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Commands/CreateFormViewCommand.php b/src/Commands/CreateFormViewCommand.php index 6af4c5a..52e0d12 100644 --- a/src/Commands/CreateFormViewCommand.php +++ b/src/Commands/CreateFormViewCommand.php @@ -27,7 +27,7 @@ class CreateFormViewCommand extends ViewsCommandBase * * @var string */ - protected $description = 'Create a from-view for the model.'; + protected $description = 'Create a form-view for the model.'; /** * Gets the name of the stub to process. @@ -65,7 +65,7 @@ protected function handleCreateView() } /** - * Replaces the form field's html code in a giving stub. + * Replaces the form field's html code in a given stub. * * @param string $stub * @param string $fields From 2c30f217829b67022a5bc8cbde5e75b23c45ad4c Mon Sep 17 00:00:00 2001 From: Logan Gray Date: Tue, 6 Mar 2018 19:33:04 -0500 Subject: [PATCH 2/6] replaced typo /misuse of word giving with given, throughout comments in code --- src/Commands/Bases/ControllerCommandBase.php | 14 +++--- .../Bases/ResourceFileCommandBase.php | 2 +- src/Commands/Bases/ViewsCommandBase.php | 16 +++---- src/Commands/CreateControllerCommand.php | 24 +++++----- src/Commands/CreateIndexViewCommand.php | 4 +- src/Commands/CreateLanguageCommand.php | 6 +-- src/Commands/CreateMigrationCommand.php | 48 +++++++++---------- src/Commands/CreateModelCommand.php | 24 +++++----- src/Commands/CreateResourcesCommand.php | 4 +- src/Commands/CreateShowViewCommand.php | 2 +- src/Commands/CreateViewLayoutCommand.php | 2 +- src/Commands/ResourceFileAppendCommand.php | 2 +- src/Commands/ResourceFileReduceCommand.php | 6 +-- src/DatabaseParsers/MysqlParser.php | 14 +++--- src/DatabaseParsers/ParserBase.php | 12 ++--- src/DatabaseParsers/SqlServerParser.php | 18 +++---- src/HtmlGenerators/HtmlGeneratorBase.php | 42 ++++++++-------- src/HtmlGenerators/LaravelCollectiveHtml.php | 6 +-- src/HtmlGenerators/StandardHtml.php | 6 +-- src/Models/Bases/MigrationChangeBase.php | 2 +- src/Models/Field.php | 46 +++++++++--------- src/Models/FieldMigrationChange.php | 6 +-- src/Models/ForeignRelationship.php | 8 ++-- src/Models/IndexMigrationChange.php | 6 +-- src/Models/MigrationCapsule.php | 2 +- src/Models/MigrationTrackerCapsule.php | 6 +-- src/Models/Resource.php | 10 ++-- src/Support/Config.php | 10 ++-- src/Support/FieldTransformer.php | 10 ++-- src/Support/FieldsOptimizer.php | 6 +-- src/Support/Helpers.php | 42 ++++++++-------- src/Support/MigrationHistoryTracker.php | 6 +-- src/Support/ResourceMapper.php | 4 +- src/Support/Str.php | 4 +- src/Support/ValidationParser.php | 4 +- src/Support/ViewLabelsGenerator.php | 6 +-- src/Traits/CommonCommand.php | 22 ++++----- src/Traits/GeneratorReplacers.php | 2 +- 38 files changed, 227 insertions(+), 227 deletions(-) diff --git a/src/Commands/Bases/ControllerCommandBase.php b/src/Commands/Bases/ControllerCommandBase.php index 537c9e4..9c3ef74 100644 --- a/src/Commands/Bases/ControllerCommandBase.php +++ b/src/Commands/Bases/ControllerCommandBase.php @@ -47,7 +47,7 @@ protected function getFillables(array $fields) } /** - * Gets laravel ready field validation format from a giving string + * Gets laravel ready field validation format from a given string * * @param string $validations * @@ -87,7 +87,7 @@ protected function getValidationRules(array $fields) } /** - * Extracts the custom validation rules' short name from the giving rules array. + * Extracts the custom validation rules' short name from the given rules array. * * @param array $rules * @@ -112,7 +112,7 @@ protected function extractCustomValidationShortName(array $rules) } /** - * Extracts the custom validation rules' short name from the giving rules array. + * Extracts the custom validation rules' short name from the given rules array. * * @param array $rules * @@ -134,7 +134,7 @@ protected function extractCustomValidationNamespaces(array $rules) } /** - * Extracts the custom validation rules from the giving rules array. + * Extracts the custom validation rules from the given rules array. * * @param array $rules * @@ -174,7 +174,7 @@ protected function makeCustomRuleCall($rule) } /** - * Get the short name of the giving custom validation rule. + * Get the short name of the given custom validation rule. * * @param string $rule * @@ -200,7 +200,7 @@ protected function canHaveUsingCommand($fullname) } /** - * Get the full class name of the giving custom valiation rule. + * Get the full class name of the given custom valiation rule. * * @param string $rule * @@ -453,7 +453,7 @@ protected function getRequestNameComment($name) } /** - * Replaces the visibility level of a giving stub + * Replaces the visibility level of a given stub * * @param string $stub * @param string $level diff --git a/src/Commands/Bases/ResourceFileCommandBase.php b/src/Commands/Bases/ResourceFileCommandBase.php index 391fbe7..c029390 100644 --- a/src/Commands/Bases/ResourceFileCommandBase.php +++ b/src/Commands/Bases/ResourceFileCommandBase.php @@ -12,7 +12,7 @@ class ResourceFileCommandBase extends Command use CommonCommand; /** - * Gets the resource from the giving file + * Gets the resource from the given file * * @param string $file * @param array $languages diff --git a/src/Commands/Bases/ViewsCommandBase.php b/src/Commands/Bases/ViewsCommandBase.php index 7e8757e..cff1eac 100644 --- a/src/Commands/Bases/ViewsCommandBase.php +++ b/src/Commands/Bases/ViewsCommandBase.php @@ -130,7 +130,7 @@ protected function getDestinationViewName($action) } /** - * It Replaces the primaryKey, modelNames, routeNames in a giving stub + * It Replaces the primaryKey, modelNames, routeNames in a given stub * * @param string $stub * @param CrestApps\CodeGenerator\Models\ViewInput $input @@ -219,7 +219,7 @@ protected function replaceFormName(&$stub, $name) } /** - * Get the view's name of a giving file. + * Get the view's name of a given file. * * @param string $fillname * @@ -233,7 +233,7 @@ protected function getViewNameFromFile($filename) } /** - * It Replaces the layout name in a giving stub + * It Replaces the layout name in a given stub * * @param string $stub * @param string $layout @@ -246,7 +246,7 @@ protected function replaceLayoutName(&$stub, $layout) } /** - * It Replaces fieldUpload in the giving stub. + * It Replaces fieldUpload in the given stub. * * @param string $stub * @param array $fields @@ -261,7 +261,7 @@ protected function replaceFileUpload(&$stub, array $fields) } /** - * It gets the file attribute based on the giving template type. + * It gets the file attribute based on the given template type. * * @param string $template * @@ -296,7 +296,7 @@ protected function createMissingViews(ViewInput $input, array $views = ['form']) } /** - * It make a valid command for creating a giving view + * It make a valid command for creating a given view * * @param string $view * @@ -364,7 +364,7 @@ protected function getFullViewsPath($viewsDirectory, $routesPrefix) } /** - * Gets the primary key name from a giving fields collection + * Gets the primary key name from a given fields collection * * @param array $fields * @@ -378,7 +378,7 @@ protected function getPrimaryKeyName(array $fields) } /** - * Gets the primary key name from a giving fields collection + * Gets the primary key name from a given fields collection * * @param array $fields * @param string $default diff --git a/src/Commands/CreateControllerCommand.php b/src/Commands/CreateControllerCommand.php index 97ffd9a..ba91740 100644 --- a/src/Commands/CreateControllerCommand.php +++ b/src/Commands/CreateControllerCommand.php @@ -181,7 +181,7 @@ protected function hasErrors(Resource $resource, $destenationFile) } /** - * Extracts a namespace from a giving string + * Extracts a namespace from a given string * * @param string $string * @@ -241,7 +241,7 @@ protected function getDataMethod(array $fields, $requestFullname, $input) } /** - * Extracts a namespace from a giving string + * Extracts a namespace from a given string * * @param string $string * @@ -304,7 +304,7 @@ protected function getDataMethodStubContent() } /** - * Get a string to set a giving $variable with a $key and $value pair + * Get a string to set a given $variable with a $key and $value pair * * @param string $key * @param string $value @@ -400,7 +400,7 @@ protected function getCommandInput() } /** - * Converts giving array of variables to a compact statements. + * Converts given array of variables to a compact statements. * * @param array $variables * @@ -558,7 +558,7 @@ protected function getModelNamespace($modelName, $modelDirectory) } /** - * Gets the setter action for the giving field on-store. + * Gets the setter action for the given field on-store. * * @param array $fields * @param string $view @@ -580,7 +580,7 @@ protected function getOnStoreAction(array $fields) } /** - * Gets the setter action for the giving field on-update. + * Gets the setter action for the given field on-update. * * @param array $fields * @param string $view @@ -602,7 +602,7 @@ protected function getOnUpdateAction(array $fields) } /** - * Gets the relation accessor for the giving foreign renationship. + * Gets the relation accessor for the given foreign renationship. * * @param CrestApps\CodeGenerator\Models\ForeignRelationship $collection * @@ -767,7 +767,7 @@ protected function getWithRelationFor(array $fields, $view) } /** - * Converts giving array of relation name to a with() statements. + * Converts given array of relation name to a with() statements. * * @param array $variables * @@ -783,7 +783,7 @@ protected function getWithRelationsStatement(array $relations) } /** - * Checks if a giving fields array conatins at least one multiple answers' field. + * Checks if a given fields array conatins at least one multiple answers' field. * * @param array * @@ -980,7 +980,7 @@ protected function replacePaginationNumber(&$stub, $total) } /** - * Replaces relationCollections for the giving stub. + * Replaces relationCollections for the given stub. * * @param $stub * @param $collections @@ -1117,7 +1117,7 @@ protected function replaceViewVariablesForShow(&$stub, $variables) } /** - * Replaces withRelationsForIndex for the giving stub. + * Replaces withRelationsForIndex for the given stub. * * @param $stub * @param $relations @@ -1130,7 +1130,7 @@ protected function replaceWithRelationsForIndex(&$stub, $relations) } /** - * Replaces withRelationsForShow for the giving stub. + * Replaces withRelationsForShow for the given stub. * * @param $stub * @param $relations diff --git a/src/Commands/CreateIndexViewCommand.php b/src/Commands/CreateIndexViewCommand.php index a0b408d..409c4c6 100644 --- a/src/Commands/CreateIndexViewCommand.php +++ b/src/Commands/CreateIndexViewCommand.php @@ -65,7 +65,7 @@ protected function handleCreateView() } /** - * Replaces the column headers in a giving stub. + * Replaces the column headers in a given stub. * * @param string $stub * @param string $header @@ -78,7 +78,7 @@ protected function replaceHeaderCells(&$stub, $header) } /** - * Replaces the column cells in a giving stub. + * Replaces the column cells in a given stub. * * @param string $stub * @param string $body diff --git a/src/Commands/CreateLanguageCommand.php b/src/Commands/CreateLanguageCommand.php index f74214e..2df8adf 100644 --- a/src/Commands/CreateLanguageCommand.php +++ b/src/Commands/CreateLanguageCommand.php @@ -176,7 +176,7 @@ protected function appendMessageToFile($fileFullname, $messages) } /** - * Gets the index on where to append messages to of a giving stub. + * Gets the index on where to append messages to of a given stub. * * @param string $stub * @@ -190,7 +190,7 @@ protected function getCursorPosition($stub) } /** - * Creates a new language file with with a giving messages. + * Creates a new language file with with a given messages. * * @param string $fileFullname * @param string $messages @@ -208,7 +208,7 @@ protected function createMessageToFile($fileFullname, $messages, $language) } /** - * Gets the full path of a giving language + * Gets the full path of a given language * * @param string $language * diff --git a/src/Commands/CreateMigrationCommand.php b/src/Commands/CreateMigrationCommand.php index 5b262d4..888ce99 100644 --- a/src/Commands/CreateMigrationCommand.php +++ b/src/Commands/CreateMigrationCommand.php @@ -282,7 +282,7 @@ protected function getCreateTableBlueprint(Resource $resource, MigrationInput $i } /** - * Gets a list of all column that are used in the giving migration + * Gets a list of all column that are used in the given migration * * @param CrestApps\CodeGenerator\Models\Resource $resource * @param CrestApps\CodeGenerator\Models\MigrationInput $input @@ -305,7 +305,7 @@ protected function getColumnsUsedInMigration(Resource $resource, MigrationInput return $columns; } /** - * Adds foreign key constraint to a giving properties. + * Adds foreign key constraint to a given properties. * * @param string $properties * @param array $constraints @@ -327,7 +327,7 @@ protected function addForeignConstraints(&$properties, array $constraints) } /** - * Gets Foreign contstrains from giving fields. + * Gets Foreign contstrains from given fields. * * @param array of CrestApps\CodeGenerator\Models\Field $field * @@ -347,7 +347,7 @@ protected function getConstraintsFromfields(array $fields) } /** - * Adds 'foreign' eloquent method to a giving properties. + * Adds 'foreign' eloquent method to a given properties. * * @param string $properties * @param CrestApps\CodeGenerator\Models\ForeignConstraint $constraint @@ -362,7 +362,7 @@ protected function addForeignConstraint(&$properties, ForeignConstraint $constra } /** - * Adds 'references' eloquent method to a giving properties. + * Adds 'references' eloquent method to a given properties. * * @param string $properties * @param CrestApps\CodeGenerator\Models\ForeignConstraint $constraint @@ -377,7 +377,7 @@ protected function addReferencesConstraint(&$properties, ForeignConstraint $cons } /** - * Adds 'on' eloquent method to a giving properties. + * Adds 'on' eloquent method to a given properties. * * @param string $properties * @param CrestApps\CodeGenerator\Models\ForeignConstraint $constraint @@ -392,7 +392,7 @@ protected function addOnConstraint(&$properties, ForeignConstraint $constraint) } /** - * Adds 'onDelete' eloquent method to a giving properties. + * Adds 'onDelete' eloquent method to a given properties. * * @param string $properties * @param CrestApps\CodeGenerator\Models\ForeignConstraint $constraint @@ -409,7 +409,7 @@ protected function addOnDeleteConstraint(&$properties, ForeignConstraint $constr } /** - * Adds 'onUpdate' eloquent method to a giving properties. + * Adds 'onUpdate' eloquent method to a given properties. * * @param string $properties * @param CrestApps\CodeGenerator\Models\ForeignConstraint $constraint @@ -426,7 +426,7 @@ protected function addOnUpdateConstraint(&$properties, ForeignConstraint $constr } /** - * Adds index method to a giving $properties + * Adds index method to a given $properties * * @param string $properties * @param array $indexes @@ -598,7 +598,7 @@ protected function getEnumParams(Field $field) } /** - * It gets label's value for each label in the giving labels + * It gets label's value for each label in the given labels * * @param array $labels * @@ -618,7 +618,7 @@ protected function getLabelValues(array $labels) } /** - * Creates the base property from a giving method. + * Creates the base property from a given method. * * @param string $method * @@ -933,7 +933,7 @@ protected function replaceConnectionName(&$stub, $name) } /** - * Adds the field's "default" value to the giving property. + * Adds the field's "default" value to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -950,7 +950,7 @@ protected function addFieldDefaultValue(&$property, Field $field) } /** - * Adds the field's "unsigned" value to the giving property. + * Adds the field's "unsigned" value to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -967,7 +967,7 @@ protected function addFieldUnsigned(&$property, Field $field) } /** - * Adds the field's "dropColumn" method call to the giving property. + * Adds the field's "dropColumn" method call to the given property. * * @param string $property * @param string $name @@ -986,7 +986,7 @@ protected function addDropColumn(&$property, $name) } /** - * Adds the field's "renameColumn" method call to the giving property. + * Adds the field's "renameColumn" method call to the given property. * * @param string $property * @param string $from @@ -1002,7 +1002,7 @@ protected function addRenameColumn(&$property, $from, $to) } /** - * Adds the field's "unique" value to the giving property. + * Adds the field's "unique" value to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -1019,7 +1019,7 @@ protected function addFieldUnique(&$property, Field $field) } /** - * Adds the field's "index" value to the giving property. + * Adds the field's "index" value to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -1066,7 +1066,7 @@ protected function dropIndex(&$property, Index $index) } /** - * Adds the field's "nullable" value to the giving property. + * Adds the field's "nullable" value to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -1083,7 +1083,7 @@ protected function addFieldNullable(&$property, Field $field) } /** - * Adds the field's "comment" value to the giving property. + * Adds the field's "comment" value to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -1100,7 +1100,7 @@ protected function addFieldComment(&$property, Field $field) } /** - * Adds the table's "engine" type to the giving property. + * Adds the table's "engine" type to the given property. * * @param string $property * @param string $name @@ -1118,7 +1118,7 @@ protected function addEngineName(&$property, $name) } /** - * Adds the table's "primary column" to the giving property. + * Adds the table's "primary column" to the given property. * * @param string $property * @param CrestApps\CodeGenerator\Models\Field $field @@ -1139,7 +1139,7 @@ protected function addPrimaryField(&$property, Field $field = null) } /** - * Adds 'updated_at' and 'created_at' columns to a giving propery. + * Adds 'updated_at' and 'created_at' columns to a given propery. * * @param string $property * @param bool $without @@ -1157,7 +1157,7 @@ protected function addTimestamps(&$property, $without = false) } /** - * Adds 'delete_at' columns to a giving propery. + * Adds 'delete_at' columns to a given propery. * * @param string $property * @param bool $withSoftDelete @@ -1175,7 +1175,7 @@ protected function addSoftDelete(&$property, $withSoftDelete = true) } /** - * Gets the correct eloquent increment method from the giving type. + * Gets the correct eloquent increment method from the given type. * * @param string $type * diff --git a/src/Commands/CreateModelCommand.php b/src/Commands/CreateModelCommand.php index 852c440..3bc8d3c 100644 --- a/src/Commands/CreateModelCommand.php +++ b/src/Commands/CreateModelCommand.php @@ -169,7 +169,7 @@ protected function getPrimaryKeyName(Field $primaryField, $primaryKey) } /** - * If a giving fields collection does not contain a field called "deleted_at", one will be created. + * If a given fields collection does not contain a field called "deleted_at", one will be created. * * @param array $fields * @@ -227,7 +227,7 @@ protected function getFillables($stub, array $fields) } /** - * Gets the fillable string from a giving raw string. + * Gets the fillable string from a given raw string. * * @param string $stub * @param string $fillablesString @@ -252,7 +252,7 @@ protected function getFillablesFromString($stub, $fillablesString) } /** - * Gets the date fields string from a giving fields array. + * Gets the date fields string from a given fields array. * * @param string $stub * @param array $fields @@ -274,7 +274,7 @@ protected function getDateFields($stub, array $fields) } /** - * Gets the castable fields in a string from a giving fields array. + * Gets the castable fields in a string from a given fields array. * * @param string $stub * @param array $fields @@ -447,7 +447,7 @@ protected function getMutators(array $fields = null) } /** - * Gets accessor for a giving field. + * Gets accessor for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $content @@ -464,7 +464,7 @@ protected function getAccessor(Field $field, $content) } /** - * Gets mutator for a giving field. + * Gets mutator for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $content @@ -540,7 +540,7 @@ protected function getTimeStampsStub($shouldUseTimeStamps, $hasUpdatedAt) } /** - * Replaces date format for the giving field. + * Replaces date format for the given field. * * @param string $stub * @param string $format @@ -553,7 +553,7 @@ protected function replaceDateFormat(&$stub, $format) } /** - * Replaces content of the giving stub. + * Replaces content of the given stub. * * @param string $stub * @param string $content @@ -709,7 +709,7 @@ protected function replacePrimaryKey(&$stub, $primaryKey) } /** - * Replaces the replationships for the giving stub. + * Replaces the replationships for the given stub. * * @param $stub * @param array $relationMethods @@ -722,7 +722,7 @@ protected function replaceRelationshipPlaceholder(&$stub, array $relationMethods } /** - * Replaces the replation type for the giving stub. + * Replaces the replation type for the given stub. * * @param string $stub * @param string $type @@ -735,7 +735,7 @@ protected function replaceRelationType(&$stub, $type) } /** - * Replaces the replation name for the giving stub. + * Replaces the replation name for the given stub. * * @param string $stub * @param string $name @@ -748,7 +748,7 @@ protected function replaceRelationName(&$stub, $name) } /** - * Replaces the replation params for the giving stub. + * Replaces the replation params for the given stub. * * @param string $stub * @param string $params diff --git a/src/Commands/CreateResourcesCommand.php b/src/Commands/CreateResourcesCommand.php index 5a3e886..93be6f6 100644 --- a/src/Commands/CreateResourcesCommand.php +++ b/src/Commands/CreateResourcesCommand.php @@ -56,7 +56,7 @@ class CreateResourcesCommand extends Command * * @var string */ - protected $description = 'Create all resources for a giving model.'; + protected $description = 'Create all resources for a given model.'; /** * Executes the console command. @@ -101,7 +101,7 @@ protected function printInfo($message) } /** - * Gets the model name in plain english from a giving model name. + * Gets the model name in plain english from a given model name. * * @param string $modelName * diff --git a/src/Commands/CreateShowViewCommand.php b/src/Commands/CreateShowViewCommand.php index f0b53ca..e25821c 100644 --- a/src/Commands/CreateShowViewCommand.php +++ b/src/Commands/CreateShowViewCommand.php @@ -64,7 +64,7 @@ protected function handleCreateView() } /** - * Replaces the table rows for the giving stub. + * Replaces the table rows for the given stub. * * @param string $stub * @param string $rows diff --git a/src/Commands/CreateViewLayoutCommand.php b/src/Commands/CreateViewLayoutCommand.php index 76b973a..8add7eb 100644 --- a/src/Commands/CreateViewLayoutCommand.php +++ b/src/Commands/CreateViewLayoutCommand.php @@ -81,7 +81,7 @@ protected function makeFile($filename, $content, $force) } /** - * Checks if the giving file exists or not. + * Checks if the given file exists or not. * If the file exists and $force is set to true the method will return true. * * @param string $filename diff --git a/src/Commands/ResourceFileAppendCommand.php b/src/Commands/ResourceFileAppendCommand.php index 4cba755..90d1d3e 100644 --- a/src/Commands/ResourceFileAppendCommand.php +++ b/src/Commands/ResourceFileAppendCommand.php @@ -80,7 +80,7 @@ public function handle() } /** - * Merges the giving file's content to the new fields. + * Merges the given file's content to the new fields. * * @param CrestApps\CodeGenerator\Models\Resource &$resource * @param (object) $input diff --git a/src/Commands/ResourceFileReduceCommand.php b/src/Commands/ResourceFileReduceCommand.php index faaae68..1644655 100644 --- a/src/Commands/ResourceFileReduceCommand.php +++ b/src/Commands/ResourceFileReduceCommand.php @@ -84,7 +84,7 @@ public function handle() } /** - * Reduces the fields from a giving resource. + * Reduces the fields from a given resource. * * @param CrestApps\CodeGenerator\Models\Resource &$resource * @param array $$fieldNames @@ -110,7 +110,7 @@ protected function reduceFields(&$resource, array $fieldNames) } /** - * Reduces the indexes from a giving resource. + * Reduces the indexes from a given resource. * * @param CrestApps\CodeGenerator\Models\Resource &$resource * @param array $indexNames @@ -138,7 +138,7 @@ protected function reduceIndexes(&$resource, array $indexNames) } /** - * Reduces the relations from a giving resource. + * Reduces the relations from a given resource. * * @param CrestApps\CodeGenerator\Models\Resource &$resource * @param array $relationNames diff --git a/src/DatabaseParsers/MysqlParser.php b/src/DatabaseParsers/MysqlParser.php index a4934ad..840abb3 100644 --- a/src/DatabaseParsers/MysqlParser.php +++ b/src/DatabaseParsers/MysqlParser.php @@ -63,7 +63,7 @@ protected function getColumns() } /** - * Gets foreign key constraint info for a giving column name. + * Gets foreign key constraint info for a given column name. * * @return mix (null|object) */ @@ -181,7 +181,7 @@ protected function getRelationTypeQuery($tableName, $columnName) } /** - * Get a corresponding relation to a giving table name, foreign column and local column. + * Get a corresponding relation to a given table name, foreign column and local column. * * @return CrestApps\CodeGenerator\Models\ForeignRelationship */ @@ -239,7 +239,7 @@ protected function getIndexes() } /** - * Gets the field after transfering it from a giving query object. + * Gets the field after transfering it from a given query object. * * @param object $column * @@ -320,7 +320,7 @@ protected function getPrecision($length, $dataType, $columnType) } /** - * Gets the data type for a giving field. + * Gets the data type for a given field. * * @param string $type * @param string $columnType @@ -343,7 +343,7 @@ protected function getDataType($type, $columnType) } /** - * Gets the foreign constrain for the giving field. + * Gets the foreign constrain for the given field. * * @param string $name * @@ -369,7 +369,7 @@ protected function getForeignConstraint($name) } /** - * Set the options for a giving field. + * Set the options for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $type @@ -386,7 +386,7 @@ protected function getHtmlOptions($dataType, $columnType) } /** - * Parses out the options from a giving type + * Parses out the options from a given type * * @param string $type * diff --git a/src/DatabaseParsers/ParserBase.php b/src/DatabaseParsers/ParserBase.php index 9d32f90..50f50f0 100644 --- a/src/DatabaseParsers/ParserBase.php +++ b/src/DatabaseParsers/ParserBase.php @@ -117,7 +117,7 @@ public function getResource() } /** - * Check if the giving fields contains autoManagedFields + * Check if the given fields contains autoManagedFields * * @return CrestApps\CodeGenerator\Models\Resource */ @@ -160,7 +160,7 @@ protected function transfer(array $fields) } /** - * Get the html type for a giving field. + * Get the html type for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $type @@ -179,7 +179,7 @@ protected function getHtmlType($type) } /** - * Set the html type for a giving field. + * Set the html type for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $type @@ -206,7 +206,7 @@ protected function getModelNamespace() } /** - * Gets the model's name from a giving table name + * Gets the model's name from a given table name * * @param string $tableName * @@ -220,7 +220,7 @@ protected function getModelName($tableName) } /** - * Make a model name from the giving table name + * Make a model name from the given table name * * @param string $tableName * @@ -241,7 +241,7 @@ protected function makeModelName($tableName) abstract protected function getColumns(); /** - * Transfers every column in the giving array to a collection of fields. + * Transfers every column in the given array to a collection of fields. * * @return array of CrestApps\CodeGenerator\Models\Field; */ diff --git a/src/DatabaseParsers/SqlServerParser.php b/src/DatabaseParsers/SqlServerParser.php index 665a773..9a2e53b 100644 --- a/src/DatabaseParsers/SqlServerParser.php +++ b/src/DatabaseParsers/SqlServerParser.php @@ -133,7 +133,7 @@ protected function transfer(array $columns) } /** - * Set the unsiged flag for a giving field. + * Set the unsiged flag for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $type @@ -151,7 +151,7 @@ protected function setUnsigned(Field & $field, $type) } /** - * Set the html type for a giving field. + * Set the html type for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $type @@ -170,7 +170,7 @@ protected function setHtmlType(Field & $field, $type) } /** - * Set the data type for a giving field. + * Set the data type for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $type @@ -189,7 +189,7 @@ protected function setDataType(Field & $field, $type) } /** - * Set the nullable for a giving field. + * Set the nullable for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $nullable @@ -204,7 +204,7 @@ protected function setIsNullable(Field & $field, $nullable) } /** - * Set the max length for a giving field. + * Set the max length for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $length @@ -222,7 +222,7 @@ protected function setMaxLength(Field & $field, $length) } /** - * Set the default value for a giving field. + * Set the default value for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $default @@ -239,7 +239,7 @@ protected function setDefault(Field & $field, $default) } /** - * Set the labels for a giving field. + * Set the labels for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $name @@ -254,7 +254,7 @@ protected function setLabel(Field & $field, $name) } /** - * Set the keys for a giving field. + * Set the keys for a given field. * * @param CrestApps\CodeGenerator\Models\Field $field * @param string $key @@ -286,7 +286,7 @@ protected function setKey(Field & $field, $key, $extra) } /** - * Gets a labe field's label from a giving name. + * Gets a labe field's label from a given name. * * @return string */ diff --git a/src/HtmlGenerators/HtmlGeneratorBase.php b/src/HtmlGenerators/HtmlGeneratorBase.php index d566441..5cd520c 100644 --- a/src/HtmlGenerators/HtmlGeneratorBase.php +++ b/src/HtmlGenerators/HtmlGeneratorBase.php @@ -97,7 +97,7 @@ public function getHtmlFields() /** * Gets html code for the show view using the current fields colelction. - * If an value is passed, it will only generate the raws based on the giving fields + * If an value is passed, it will only generate the raws based on the given fields * * @param array $fields * @@ -118,7 +118,7 @@ public function getShowRowsHtml(array $fields = null) } /** - * Gets show row html code for the giving field. + * Gets show row html code for the given field. * * @param string $stub * @param CreatApps\Models\Field $field @@ -137,7 +137,7 @@ protected function getShowRowHtmlField($stub, Field $field) /** * Gets header cells' html code for the index view using the current fields colelction. - * If an value is passed, it will only generate the raws based on the giving fields + * If an value is passed, it will only generate the raws based on the given fields * * @param array $fields * @@ -179,7 +179,7 @@ public function replaceCommonTemplates(&$stub, Field $field) /** * Gets header body's html code for the index view using the current fields colelction. - * If an value is passed, it will only generate the raws based on the giving fields + * If an value is passed, it will only generate the raws based on the given fields * * @param array $fields * @@ -199,7 +199,7 @@ public function getIndexBodyCells(array $fields = null) } /** - * Gets index body cell html code for the giving field. + * Gets index body cell html code for the given field. * * @param string $stub * @param CreatApps\Models\Field $field @@ -300,7 +300,7 @@ protected function getFieldAccessorValue(Field $field, $view) } /** - * It find the union field between a giving collection and the current field collection. + * It find the union field between a given collection and the current field collection. * If null is provided, the current field collection is returned. * * @param array $fields @@ -319,7 +319,7 @@ protected function getFieldsToDisplay(array $fields = null) } /** - * Gets creates an textarea html field for a giving field. + * Gets creates an textarea html field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @param CrestApps\CodeGeneraotor\Support\ValidationParser $parser @@ -382,7 +382,7 @@ protected function getHtmlMaxValue($validationMaxValue, $fieldMaxValue) } /** - * Gets creates an checkbox/radio button html field for a giving field. + * Gets creates an checkbox/radio button html field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @param CrestApps\CodeGeneraotor\Support\ValidationParser $parser @@ -412,7 +412,7 @@ protected function getPickItemsHtml(Field $field, ValidationParser $parser) } /** - * Gets creates a checkbox or radio button html field for a giving field. + * Gets creates a checkbox or radio button html field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @param CrestApps\CodeGeneraotor\Support\Label $option @@ -451,7 +451,7 @@ protected function getFieldNameAsArray($name) } /** - * Gets creates an select menu html field for a giving field. + * Gets creates an select menu html field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @param CrestApps\CodeGeneraotor\Support\ValidationParser $parser @@ -562,7 +562,7 @@ protected function getSelectedValueForMenu(Field $field) } /** - * Gets creates an password html5 field for a giving field. + * Gets creates an password html5 field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @@ -582,7 +582,7 @@ public function getFileHtmlField(Field $field) } /** - * Gets a rangeselector element for a giving field. + * Gets a rangeselector element for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @@ -604,7 +604,7 @@ public function getSelectRangeHtmlField(Field $field) } /** - * Gets a selectmonth element for a giving field. + * Gets a selectmonth element for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @@ -624,7 +624,7 @@ public function getSelectMonthHtmlField(Field $field) } /** - * Gets creates an password html5 field for a giving field. + * Gets creates an password html5 field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @param CrestApps\CodeGeneraotor\Support\ValidationParser $parser @@ -654,7 +654,7 @@ public function getPasswordHtmlField(Field $field, ValidationParser $parser) } /** - * Gets creates an standard html5 field for a giving field. + * Gets creates an standard html5 field for a given field. * * @param CrestApps\CodeGeneraotor\Support\Field $field * @param CrestApps\CodeGeneraotor\Support\ValidationParser $parser @@ -685,7 +685,7 @@ public function getStandardHtmlField(Field $field, ValidationParser $parser) } /** - * Gets the gretest value of the giving parameters. It ignores null or empty string. + * Gets the gretest value of the given parameters. It ignores null or empty string. * * @return numeric */ @@ -699,7 +699,7 @@ protected function getMax() } /** - * Gets the smallest value of the giving parameters. It ignores null or empty string. + * Gets the smallest value of the given parameters. It ignores null or empty string. * * @return numeric */ @@ -738,7 +738,7 @@ protected function wrapField(&$fieldStub, Field $field, $standardLabel = true, $ } /** - * Creates html label from a giving field + * Creates html label from a given field * * @param CrestApps\CodeGenerator\Models\Field $field * @@ -800,7 +800,7 @@ protected function getRequiredClass($class) } /** - * Gets an array of key/value string from a giving labels collection. + * Gets an array of key/value string from a given labels collection. * * @param array $labels * @@ -833,7 +833,7 @@ protected function getTranslatedTitle(Label $label, $raw = false) } /** - * Gets title to display from a giving label. + * Gets title to display from a given label. * * @param CrestApps\CodeGenerator\Models\Label $label * @param bool $raw @@ -1294,7 +1294,7 @@ abstract protected function getFieldPlaceHolderForMenu(Label $placeholder = null abstract protected function getFieldMultiple($isMulti); /** - * Gets a plain title from a giving label. + * Gets a plain title from a given label. * * @param CrestApps\CodeGenerator\Models\Label $label * @param bool $raw diff --git a/src/HtmlGenerators/LaravelCollectiveHtml.php b/src/HtmlGenerators/LaravelCollectiveHtml.php index 4dcbd7d..0781198 100644 --- a/src/HtmlGenerators/LaravelCollectiveHtml.php +++ b/src/HtmlGenerators/LaravelCollectiveHtml.php @@ -123,7 +123,7 @@ protected function getFieldItems(Field $field) } /** - * Gets a plain title from a giving label. + * Gets a plain title from a given label. * * @param CrestApps\CodeGenerator\Models\Label $label * @param bool $raw @@ -200,7 +200,7 @@ protected function getMultipleCheckedItem($value, $name, $defaultValue) } /** - * Gets a raw value for a giving field's name. + * Gets a raw value for a given field's name. * * @param string $name * @param string $value @@ -216,7 +216,7 @@ protected function getRawOptionValue($name, $value) } /** - * Gets a raw value for a giving field's name. + * Gets a raw value for a given field's name. * * @param string $name * @param string $value diff --git a/src/HtmlGenerators/StandardHtml.php b/src/HtmlGenerators/StandardHtml.php index 4c6ee17..a1cdd32 100644 --- a/src/HtmlGenerators/StandardHtml.php +++ b/src/HtmlGenerators/StandardHtml.php @@ -134,7 +134,7 @@ protected function getFieldItems(Field $field) } /** - * Gets a plain title from a giving label. + * Gets a plain title from a given label. * * @param CrestApps\CodeGenerator\Models\Label $label * @param bool $raw @@ -245,7 +245,7 @@ protected function getSelectedValue($name, $valueAccessor, $defaultValue) } /** - * Gets a raw value for a giving field's name. + * Gets a raw value for a given field's name. * * @param string $name * @param string $value @@ -264,7 +264,7 @@ protected function getRawOptionValue($name, $value) } /** - * Gets a raw value for a giving field's name. + * Gets a raw value for a given field's name. * * @param string $name * @param string $value diff --git a/src/Models/Bases/MigrationChangeBase.php b/src/Models/Bases/MigrationChangeBase.php index be8e58f..1c56306 100644 --- a/src/Models/Bases/MigrationChangeBase.php +++ b/src/Models/Bases/MigrationChangeBase.php @@ -21,7 +21,7 @@ class MigrationChangeBase public $isDeleted = false; /** - * Get a raw property using the giving property name + * Get a raw property using the given property name * * @return mix (null | array) */ diff --git a/src/Models/Field.php b/src/Models/Field.php index 65673ca..0102b5d 100644 --- a/src/Models/Field.php +++ b/src/Models/Field.php @@ -413,7 +413,7 @@ public function getPlaceholders() } /** - * Gets a label by a giving language + * Gets a label by a given language * * @param string $lang * @@ -431,7 +431,7 @@ public function getLabel($lang = null) } /** - * Gets a label by a giving language + * Gets a label by a given language * * @param string $lang * @@ -565,7 +565,7 @@ public function setForeignConstraint(ForeignConstraint $constraint = null) } /** - * It set the placeholder property for a giving field + * It set the placeholder property for a given field * * @param CrestApps\CodeGenerator\Models\Field $field * @param array $properties @@ -584,7 +584,7 @@ protected function setPlaceholder(array $properties) } /** - * It get the labels from a giving array + * It get the labels from a given array * * @param array $items * @@ -675,7 +675,7 @@ public function hasForeignConstraint() return !is_null($this->foreignConstraint); } /** - * Checks if the field is on a giving view. + * Checks if the field is on a given view. * * @return bool */ @@ -708,7 +708,7 @@ public function addOption($text, $isPlain = true, $lang = 'en', $value = null) } /** - * Gets a options by a giving language + * Gets a options by a given language * * @param string $lang * @@ -795,7 +795,7 @@ public function isCheckbox() } /** - * Check if the Eloquent data method is changable to the giving type + * Check if the Eloquent data method is changable to the given type * * @var bool */ @@ -805,7 +805,7 @@ public function isDataChangeAllowed($type) } /** - * Creates locale key for a giving languagefile + * Creates locale key for a given languagefile * * @param string $stub * @param string $postFix @@ -929,7 +929,7 @@ public function setOnStore(array $properties) } /** - * Sets the range for a giving field + * Sets the range for a given field * * @param array $properties * @@ -949,7 +949,7 @@ public function setRange(array $properties) } /** - * It set the options property for a giving field + * It set the options property for a given field * * @param array $properties @@ -1017,7 +1017,7 @@ public function setOnUpdate(array $properties) } /** - * Cleans up a giving action + * Cleans up a given action * * @param string $action * @@ -1035,7 +1035,7 @@ public function getOnAction($action) } /** - * Sets the DataTypeParam for a giving field + * Sets the DataTypeParam for a given field * * @param array $properties * @@ -1051,7 +1051,7 @@ public function setDataTypeParams(array $properties) } /** - * Gets the data type parameters for the giving type. + * Gets the data type parameters for the given type. * * @param array $params * @@ -1078,7 +1078,7 @@ public function getDataTypeParams(array $params) } /** - * It set the labels property for a giving field + * It set the labels property for a given field * * @param array $properties * @@ -1129,7 +1129,7 @@ protected function getLabelsFromProperties(array $properties) } /** - * It set the validationRules property for a giving field + * It set the validationRules property for a given field * * @param array $properties * @@ -1196,7 +1196,7 @@ public function setValidationProperty(array $properties) } /** - * Sets the isUnsigned for a giving field + * Sets the isUnsigned for a given field * * @param array $properties * @@ -1211,7 +1211,7 @@ public function setUnsigned(array $properties) } /** - * Sets the foreign relations for a giving field + * Sets the foreign relations for a given field * * @param array $properties * @@ -1247,7 +1247,7 @@ protected function setForeignRelationFromArray(array $properties) } /** - * Sets the foreign key for a giving field + * Sets the foreign key for a given field * * @param array $properties * @@ -1283,7 +1283,7 @@ protected function getForeignConstraintFromArray(array $properties) } /** - * Check if giving properties contains a valid foreign key object + * Check if given properties contains a valid foreign key object * * @param array $properties * @@ -1585,7 +1585,7 @@ public function getMinValue() } /** - * Gets method's parameter for a giving index. + * Gets method's parameter for a given index. * * @return mix (int|null) */ @@ -1717,7 +1717,7 @@ public static function isValidSelectRangeType(array $properties) ]; /** - * It set the predefined property for a giving field. + * It set the predefined property for a given field. * it uses the predefinedKeyMapping array * * @param array $properties @@ -1742,7 +1742,7 @@ public function setPredefindProperties(array $properties) } /** - * It gets the name of the field from a giving array + * It gets the name of the field from a given array * * @param array $properties * @throws Exception @@ -1761,7 +1761,7 @@ public static function getNameFromArray(array $properties) } /** - * It set the predefined property for a giving field. + * It set the predefined property for a given field. * it uses the predefinedKeyMapping array * * @param array $properties diff --git a/src/Models/FieldMigrationChange.php b/src/Models/FieldMigrationChange.php index d9a3d0b..235c3c0 100644 --- a/src/Models/FieldMigrationChange.php +++ b/src/Models/FieldMigrationChange.php @@ -84,7 +84,7 @@ public function isRenamed() } /** - * Get new migration change from the giving field + * Get new migration change from the given field * * @param CrestApps\CodeGenerator\Models\Field $field * @@ -100,7 +100,7 @@ public static function getAdded(Field $field) } /** - * Get new migration change from the giving field + * Get new migration change from the given field * * @param CrestApps\CodeGenerator\Models\Field $field * @@ -116,7 +116,7 @@ public static function getDeleted(Field $field) return $change; } /** - * Get the migration change after comparing two giving fields + * Get the migration change after comparing two given fields * * @param CrestApps\CodeGenerator\Models\Field $fieldA * @param CrestApps\CodeGenerator\Models\Field $fieldB diff --git a/src/Models/ForeignRelationship.php b/src/Models/ForeignRelationship.php index 734c592..76ff840 100644 --- a/src/Models/ForeignRelationship.php +++ b/src/Models/ForeignRelationship.php @@ -271,7 +271,7 @@ public function getForeignModel() } /** - * Check if a giving class is an an instance of Model + * Check if a given class is an an instance of Model * * @return bool */ @@ -423,7 +423,7 @@ public function toArray() } /** - * Get a foreign relationship from giving array + * Get a foreign relationship from given array * * @param array $options * @@ -446,7 +446,7 @@ public static function get(array $options) } /** - * Get a foreign relationship from giving string + * Get a foreign relationship from given string * * @param string $rawRelation * @@ -479,7 +479,7 @@ public static function fromString($rawRelation) } /** - * Get a predictable foreign relation using the giving field's name + * Get a predictable foreign relation using the given field's name * * @param string $fieldName * @param string $modelPath diff --git a/src/Models/IndexMigrationChange.php b/src/Models/IndexMigrationChange.php index 47ae073..3f77ffd 100644 --- a/src/Models/IndexMigrationChange.php +++ b/src/Models/IndexMigrationChange.php @@ -41,7 +41,7 @@ public function hasChange() } /** - * Get new migration change from the giving index + * Get new migration change from the given index * * @param CrestApps\CodeGenerator\Models\Index $index * @@ -57,7 +57,7 @@ public static function getAdded(Index $index) } /** - * Get new migration change from the giving index + * Get new migration change from the given index * * @param CrestApps\CodeGenerator\Models\Index $index * @@ -73,7 +73,7 @@ public static function getDeleted(Index $index) return $change; } /** - * Get the migration change after comparing two giving fields + * Get the migration change after comparing two given fields * * @param CrestApps\CodeGenerator\Models\Field $fieldA * @param CrestApps\CodeGenerator\Models\Field $fieldB diff --git a/src/Models/MigrationCapsule.php b/src/Models/MigrationCapsule.php index 67adf8d..80df53b 100644 --- a/src/Models/MigrationCapsule.php +++ b/src/Models/MigrationCapsule.php @@ -183,7 +183,7 @@ public function hasChange() } /** - * Gets an instance of Migration Capsule using the giving name + * Gets an instance of Migration Capsule using the given name * * @param string $name * diff --git a/src/Models/MigrationTrackerCapsule.php b/src/Models/MigrationTrackerCapsule.php index 156365d..abb8cdd 100644 --- a/src/Models/MigrationTrackerCapsule.php +++ b/src/Models/MigrationTrackerCapsule.php @@ -127,7 +127,7 @@ public function getDelta(Resource $resourceA, Resource $resourceB, MigrationInpu } /** - * Get the field difference between two giving Field arrays + * Get the field difference between two given Field arrays * * @param array $fieldsA * @param array $fieldsB @@ -170,7 +170,7 @@ protected function getFieldsDelta(array $fieldsA, array $fieldsB) } /** - * Get the field difference between two giving Index arrays + * Get the field difference between two given Index arrays * * @param array $indexesA * @param array $indexesB @@ -322,7 +322,7 @@ public function getCurrentMigration() } /** - * Checks if the giving migration name is the current one + * Checks if the given migration name is the current one * * @return bool */ diff --git a/src/Models/Resource.php b/src/Models/Resource.php index e7b12e1..0877bbf 100644 --- a/src/Models/Resource.php +++ b/src/Models/Resource.php @@ -158,7 +158,7 @@ public function getProtections() } /** - * Checks if the giving resource is protected or not. + * Checks if the given resource is protected or not. * * @return bool */ @@ -240,7 +240,7 @@ public function hasPrimaryField() } /** - * Extracts the giving property name from the fields + * Extracts the given property name from the fields * * @return array */ @@ -260,7 +260,7 @@ public function pluckFields($property = 'name') } /** - * Extracts the giving property name from the fields + * Extracts the given property name from the fields * * @return array */ @@ -411,7 +411,7 @@ public function getIndexesToArray() } /** - * It transfres a giving string to a collection of field + * It transfres a given string to a collection of field * * @param string|json $json * @param string $localeGroup @@ -427,7 +427,7 @@ public static function fromFile($filename, $localeGroup, array $languages = []) } /** - * It transfres a giving JSON string to a collection of field + * It transfres a given JSON string to a collection of field * * @param string|json $json * @param string $localeGroup diff --git a/src/Support/Config.php b/src/Support/Config.php index 66648d9..85a2bf0 100644 --- a/src/Support/Config.php +++ b/src/Support/Config.php @@ -74,7 +74,7 @@ public static function getFormRequestNamePostFix() } /** - * Checks if a giving file type should be a plural or not. + * Checks if a given file type should be a plural or not. * * @return array */ @@ -503,7 +503,7 @@ public static function getCustomModelTemplates() } /** - * Get the config value of the giving index, using the default configs. + * Get the config value of the given index, using the default configs. * * @param string $index * @param string $default = null @@ -518,7 +518,7 @@ public static function get($index, $default = null) } /** - * Get the config value of the giving index, using the custom configs. + * Get the config value of the given index, using the custom configs. * * @param string $index * @param string $default = null @@ -533,7 +533,7 @@ public static function getCustom($index, $default = null) } /** - * Checks of the default-configs has a giving key + * Checks of the default-configs has a given key * * @param string $index * @@ -547,7 +547,7 @@ public static function has($index) } /** - * Checks of the custom-configs has a giving key + * Checks of the custom-configs has a given key * * @param string $index * diff --git a/src/Support/FieldTransformer.php b/src/Support/FieldTransformer.php index 54b3b05..53a49ad 100644 --- a/src/Support/FieldTransformer.php +++ b/src/Support/FieldTransformer.php @@ -286,7 +286,7 @@ public function presetProperties(array &$properties) } /** - * Gets labels from a giving title and field name. + * Gets labels from a given title and field name. * * @param string $title * @param string $name @@ -317,7 +317,7 @@ protected function getLabels($title, $name) } /** - * Gets options from a giving array of options + * Gets options from a given array of options * * @param string $name * @@ -335,7 +335,7 @@ protected function getFirstElement(array $array) } /** - * Gets options from a giving array of options + * Gets options from a given array of options * * @param string $name * @@ -363,7 +363,7 @@ protected function getOptions(array $options) } /** - * Gets labels from a giving title and field name. + * Gets labels from a given title and field name. * * @param string $name * @@ -383,7 +383,7 @@ protected function getPlaceholders($name, $htmlType) } /** - * Gets the html-type from the giving array + * Gets the html-type from the given array * * @param array $properties * diff --git a/src/Support/FieldsOptimizer.php b/src/Support/FieldsOptimizer.php index 14cb8be..792c080 100644 --- a/src/Support/FieldsOptimizer.php +++ b/src/Support/FieldsOptimizer.php @@ -80,7 +80,7 @@ protected function addField(Field $field) } /** - * Assigned and fix the primary key field of the giving collection. + * Assigned and fix the primary key field of the given collection. * * @param array $mappers * @@ -107,7 +107,7 @@ protected function assignPrimaryKey(array & $mappers) } /** - * Giving a mappers collection, it'll update the the field by making one as primary title + * given a mappers collection, it'll update the the field by making one as primary title * * @param CrestApps\CodeGenerator\Models\Field $field * @return bool @@ -138,7 +138,7 @@ protected function assignPrimaryTitle(array & $mappers) } /** - * It checks if a giving field is a primary or not. + * It checks if a given field is a primary or not. * * @param CrestApps\CodeGenerator\Models\Field $field * @return bool diff --git a/src/Support/Helpers.php b/src/Support/Helpers.php index e025420..94dfef6 100644 --- a/src/Support/Helpers.php +++ b/src/Support/Helpers.php @@ -11,7 +11,7 @@ class Helpers { /** - * Makes a controller name from a giving model name + * Makes a controller name from a given model name * * @param string $modelName * @@ -30,7 +30,7 @@ public static function makeControllerName($modelName) } /** - * Eliminate a duplicate giving phrase from a giving string + * Eliminate a duplicate given phrase from a given string * * @param string $subject * @param string $eliminate @@ -79,7 +79,7 @@ public static function getAppNamespace() } /** - * Checks an array for the first value that starts with a giving pattern + * Checks an array for the first value that starts with a given pattern * * @param array $subjects * @param string $search @@ -110,7 +110,7 @@ public static function prettifyJson(array $object) } /** - * Gets a label from a giving name + * Gets a label from a given name * * @param string $name * @@ -143,7 +143,7 @@ public static function makeFormRequestName($modelName) } /** - * Creates a colection of messages out of a giving fields collection. + * Creates a colection of messages out of a given fields collection. * * @param array $fields * @@ -179,7 +179,7 @@ public static function getLanguageItems(array $fields) } /** - * Guesses the model full name using the giving field's name + * Guesses the model full name using the given field's name * * @param string $name * @param string $modelsPath @@ -194,7 +194,7 @@ public static function guessModelFullName($name, $modelsPath) } /** - * Extracts the model name from the giving field's name. + * Extracts the model name from the given field's name. * * @param string $name * @@ -208,7 +208,7 @@ public static function extractModelName($name) } /** - * Checks if a key exists in a giving array + * Checks if a key exists in a given array * * @param array $properties * @param string $name @@ -241,7 +241,7 @@ public static function makeLocaleGroup($modelName) } /** - * Makes the proper english case giving a model name and a file type + * Makes the proper english case given a model name and a file type * * @param string $modelName * @param string $key @@ -260,7 +260,7 @@ public static function getProperCaseFor($modelName, $key = null) } /** - * Makes the table name from the giving model name. + * Makes the table name from the given model name. * * @param string $modelName * @@ -272,7 +272,7 @@ public static function makeTableName($modelName) } /** - * Makes the route group from the giving model name. + * Makes the route group from the given model name. * * @param string $modelName * @@ -298,7 +298,7 @@ public static function makeJsonFileName($modelName) } /** - * Evaluates the current version of the framework to see if it >= a giving version. + * Evaluates the current version of the framework to see if it >= a given version. * * @param $version * @@ -355,7 +355,7 @@ public static function removeEmptyItems(array $items, $callback = null) } /** - * Checks if a string matches at least one giving pattern + * Checks if a string matches at least one given pattern * * @param string|array $patterns * @param string $subject @@ -419,7 +419,7 @@ public static function removeNonEnglishChars($str, $keep = '') } /** - * Checks if a giving array is associative + * Checks if a given array is associative * * @param array $items * @@ -431,7 +431,7 @@ public static function isAssociative(array $items) } /** - * Converts slash to back slash of a giving string + * Converts slash to back slash of a given string * * @return string */ @@ -457,7 +457,7 @@ public static function stringToBool($str) } /** - * Removes a string from the end of another giving string if it already ends with it. + * Removes a string from the end of another given string if it already ends with it. * * @param string $name * @param string $fix @@ -476,7 +476,7 @@ public static function removePostFixWith($name, $fix = '/') } /** - * Adds a postFix string at the end of another giving string if it does not already ends with it. + * Adds a postFix string at the end of another given string if it does not already ends with it. * * @param string $name * @param string $fix @@ -493,7 +493,7 @@ public static function postFixWith($name, $fix = '/') } /** - * Adds a preFix string at the begining of another giving string if it does not already ends with it. + * Adds a preFix string at the begining of another given string if it does not already ends with it. * * @param string $name * @param string $fix @@ -546,7 +546,7 @@ public static function upperCaseEveyWord($sentence, $delimiter = '\\') } /** - * Wrapps each item in an array with a giving string + * Wrapps each item in an array with a given string * * @return array */ @@ -560,7 +560,7 @@ public static function wrapItems(array $items, $wrapper = "'") } /** - * Trims a giving string from whitespaces and single/double quotes and square brake. + * Trims a given string from whitespaces and single/double quotes and square brake. * * @return string */ @@ -570,7 +570,7 @@ public static function trimQuots($str) } /** - * It splits a giving string by a giving seperator after trimming each part + * It splits a given string by a given seperator after trimming each part * from whitespaces and single/double quotes. Any empty string is eliminated. * * @param string $str diff --git a/src/Support/MigrationHistoryTracker.php b/src/Support/MigrationHistoryTracker.php index 7de3085..3101c1c 100644 --- a/src/Support/MigrationHistoryTracker.php +++ b/src/Support/MigrationHistoryTracker.php @@ -101,7 +101,7 @@ public function update($tableName, array $properties) } /** - * Checks if a migration tracker exists for a giving datatable + * Checks if a migration tracker exists for a given datatable * * @param string $tableName * @@ -170,7 +170,7 @@ protected function read() } /** - * Removeds a migration entry from the file giving the table name. + * Removeds a migration entry from the file given the table name. * * @param string $tableName * @@ -237,7 +237,7 @@ public function addMigration($tableName, MigrationCapsule $migrationCapsule) } /** - * Remove a migration entry from the file giving the table name and migration name. + * Remove a migration entry from the file given the table name and migration name. * * @param string $tableName * @param string $name diff --git a/src/Support/ResourceMapper.php b/src/Support/ResourceMapper.php index 9bcb1a5..314f09e 100644 --- a/src/Support/ResourceMapper.php +++ b/src/Support/ResourceMapper.php @@ -28,7 +28,7 @@ public function __construct(Command $command) } /** - * Gets the first map with the giving model name + * Gets the first map with the given model name * * @param string $value * @param string $key @@ -52,7 +52,7 @@ public static function first($value, $key = 'model-name') } /** - * Gets the first map with the giving model name then get a specific property/key + * Gets the first map with the given model name then get a specific property/key * * @param string $value * @param string $key diff --git a/src/Support/Str.php b/src/Support/Str.php index 5f0bb1a..b693cb3 100644 --- a/src/Support/Str.php +++ b/src/Support/Str.php @@ -8,7 +8,7 @@ class Str { /** - * Gets a plural version of a giving word. + * Gets a plural version of a given word. * * @param string $word * @@ -26,7 +26,7 @@ public static function plural($word) } /** - * Gets a singular version of a giving word. + * Gets a singular version of a given word. * * @param string $word * diff --git a/src/Support/ValidationParser.php b/src/Support/ValidationParser.php index 2a4a6bd..1a806f7 100644 --- a/src/Support/ValidationParser.php +++ b/src/Support/ValidationParser.php @@ -295,7 +295,7 @@ public function isInteger() } /** - * Checks if a giving rule is required + * Checks if a given rule is required * * @param string $name * @@ -328,7 +328,7 @@ protected function getFirst($key) } /** - * Checks if any rule starts with a giving key + * Checks if any rule starts with a given key * * @param string $key * diff --git a/src/Support/ViewLabelsGenerator.php b/src/Support/ViewLabelsGenerator.php index 8d12002..95dbb1b 100644 --- a/src/Support/ViewLabelsGenerator.php +++ b/src/Support/ViewLabelsGenerator.php @@ -68,7 +68,7 @@ public function __construct($modelName, array $fields, $isCollectiveTemplate) } /** - * Gets translatable labels for the giving languages if any + * Gets translatable labels for the given languages if any * * @param array $languages * @@ -89,7 +89,7 @@ public function getTranslatedLabels(array $languages) } /** - * Gets translatable labels for the giving languages if any, + * Gets translatable labels for the given languages if any, * otherwise, get plain labels * * @param array $languages @@ -150,7 +150,7 @@ protected function makeModelLabel($key, array $properties, $isPlain, $lang) } /** - * Checks if the giving properties request to put the label in a function. + * Checks if the given properties request to put the label in a function. * * @param array $properties * diff --git a/src/Traits/CommonCommand.php b/src/Traits/CommonCommand.php index c9c8bf5..ffdfa5e 100644 --- a/src/Traits/CommonCommand.php +++ b/src/Traits/CommonCommand.php @@ -52,7 +52,7 @@ trait CommonCommand ]; /** - * Replaces a template variable in the giving subject. + * Replaces a template variable in the given subject. * * @return string */ @@ -64,7 +64,7 @@ protected function strReplace($search, $replace, $subject) } /** - * Replaces a template variable in the giving subject. + * Replaces a template variable in the given subject. * * @param string $search * @param string $replace @@ -90,7 +90,7 @@ protected function getTemplateVariable($key) } /** - * Gets the relation accessor for the giving foreign renationship. + * Gets the relation accessor for the given foreign renationship. * * @param string $name * @@ -130,7 +130,7 @@ public function arguments() } /** - * Gets plural variable instance of a giving model. + * Gets plural variable instance of a given model. * * @param string $name * @@ -150,7 +150,7 @@ public function getPluralVariable($name) } /** - * Gets singular variable instance of a giving model. + * Gets singular variable instance of a given model. * * @param string $name * @@ -235,7 +235,7 @@ public function generatorOption($key) } /** - * It Replaces the view names in a giving stub + * It Replaces the view names in a given stub * * @param string $stub * @param string $viewDirectory @@ -400,7 +400,7 @@ protected function deleteFile($file) } /** - * Adds content to a giving file. + * Adds content to a given file. * * @param string $file * @@ -414,7 +414,7 @@ protected function putContentInFile($file, $content) } /** - * Adds content to a giving file. + * Adds content to a given file. * * @param string $file * @@ -428,7 +428,7 @@ protected function appendContentToFile($file, $content) } /** - * Determine the primary field in a giving array + * Determine the primary field in a given array * * @param array $fields * @@ -526,7 +526,7 @@ protected function getPathToTemplates($template = null) } /** - * Checks the giving template if it is a Laravel-Collective template or not. + * Checks the given template if it is a Laravel-Collective template or not. * * @param string $template * @@ -538,7 +538,7 @@ protected function isCollectiveTemplate($template = null) } /** - * Checks if a giving fields array conatins at least one file field + * Checks if a given fields array conatins at least one file field * * @param array * diff --git a/src/Traits/GeneratorReplacers.php b/src/Traits/GeneratorReplacers.php index 4f3927f..5efd093 100644 --- a/src/Traits/GeneratorReplacers.php +++ b/src/Traits/GeneratorReplacers.php @@ -85,7 +85,7 @@ protected function replaceControllerName(&$stub, $name) } /** - * It Replaces the primary key in a giving stub + * It Replaces the primary key in a given stub * * @param string $stub * @param string $primaryKey From 151954fda5031038db03a21b6fdcd2266253591e Mon Sep 17 00:00:00 2001 From: Logan Gray Date: Tue, 6 Mar 2018 19:39:42 -0500 Subject: [PATCH 3/6] friendly comment about using the --force if a view, model or controller already exists --- src/Commands/CreateControllerCommand.php | 2 +- src/Commands/CreateModelCommand.php | 2 +- src/Commands/CreateViewLayoutCommand.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Commands/CreateControllerCommand.php b/src/Commands/CreateControllerCommand.php index ba91740..6cb5f0a 100644 --- a/src/Commands/CreateControllerCommand.php +++ b/src/Commands/CreateControllerCommand.php @@ -172,7 +172,7 @@ protected function hasErrors(Resource $resource, $destenationFile) } if ($this->alreadyExists($destenationFile)) { - $this->error('The controller already exists!'); + $this->error('The controller already exists! To override the existing file, use --force option.'); $hasErrors = true; } diff --git a/src/Commands/CreateModelCommand.php b/src/Commands/CreateModelCommand.php index 3bc8d3c..077e630 100644 --- a/src/Commands/CreateModelCommand.php +++ b/src/Commands/CreateModelCommand.php @@ -115,7 +115,7 @@ protected function hasErrors(Resource $resource, $destenationFile) } if ($this->alreadyExists($destenationFile)) { - $this->error('The model already exists!'); + $this->error('The model already exists! To override the existing file, use --force option.'); $hasErrors = true; } diff --git a/src/Commands/CreateViewLayoutCommand.php b/src/Commands/CreateViewLayoutCommand.php index 8add7eb..000edbb 100644 --- a/src/Commands/CreateViewLayoutCommand.php +++ b/src/Commands/CreateViewLayoutCommand.php @@ -45,7 +45,7 @@ public function handle() $destenationFile = $path . $input->layoutFileName; if ($this->alreadyExists($destenationFile)) { - $this->error('The layout already exists!'); + $this->error('The layout already exists! To override the existing file, use --force option.'); return false; } @@ -70,7 +70,7 @@ public function handle() protected function makeFile($filename, $content, $force) { if ($this->fileExists($filename, $force)) { - throw new Exception('The destenation file already exists. To override the existing file, pass "--force" option.'); + throw new Exception('The destination file already exists. To override the existing file, pass "--force" option.'); } if (!File::put($filename, $content)) { From f0626a82e42c3b1f4efe570323bba8b96de5fbb5 Mon Sep 17 00:00:00 2001 From: Logan Gray Date: Tue, 6 Mar 2018 19:55:12 -0500 Subject: [PATCH 4/6] friendlier and instructive message when resource file has not been found / created. --- src/Models/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Resource.php b/src/Models/Resource.php index 0877bbf..3d5e07b 100644 --- a/src/Models/Resource.php +++ b/src/Models/Resource.php @@ -546,7 +546,7 @@ public static function jsonFileContent($filename) $fileFullname = Config::getResourceFilePath($filename); if (!File::exists($fileFullname)) { - throw new Exception('The file ' . $fileFullname . ' was not found!'); + throw new Exception('The resource file ' . $fileFullname . ' was not found! Perhaps, you need to run PHP artisan resource-file:create [name] or resource-file:from-database [tablename] '); } return File::get($fileFullname); From bd61c3a6a7f389d0af7d47f86f9e4e7cf493ce82 Mon Sep 17 00:00:00 2001 From: Logan Gray Date: Tue, 6 Mar 2018 19:55:51 -0500 Subject: [PATCH 5/6] slightly more descriptive phpdoc block --- src/Models/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Resource.php b/src/Models/Resource.php index 3d5e07b..fdd41c6 100644 --- a/src/Models/Resource.php +++ b/src/Models/Resource.php @@ -535,7 +535,7 @@ protected static function getIndexes(array $properties) } /** - * Gets the content of a json file. + * Gets the content of the resource json file. * * @param $filename * From a0a328189bc55311314fa2c7570a52e3e747a607 Mon Sep 17 00:00:00 2001 From: CrestApps Date: Tue, 6 Mar 2018 17:38:01 -0800 Subject: [PATCH 6/6] Update Resource.php Updated the parameter name --- src/Models/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Resource.php b/src/Models/Resource.php index fdd41c6..f44816f 100644 --- a/src/Models/Resource.php +++ b/src/Models/Resource.php @@ -546,7 +546,7 @@ public static function jsonFileContent($filename) $fileFullname = Config::getResourceFilePath($filename); if (!File::exists($fileFullname)) { - throw new Exception('The resource file ' . $fileFullname . ' was not found! Perhaps, you need to run PHP artisan resource-file:create [name] or resource-file:from-database [tablename] '); + throw new Exception('The resource file ' . $fileFullname . ' was not found! Perhaps, you need to run PHP artisan resource-file:create [model-name] or resource-file:from-database [model-name] '); } return File::get($fileFullname);