Skip to content

Commit

Permalink
Merge pull request #120 from Log1x/log1x/inflector
Browse files Browse the repository at this point in the history
Add support for doctrine/inflector ^2.0
  • Loading branch information
stevep authored Jul 2, 2020
2 parents c6c066f + d2edd23 commit 1fbdb58
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 64 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"description": "An Advanced Custom Field Configuration Builder",
"require": {
"php": ">=5.4.0",
"doctrine/inflector": "^1.1",
"doctrine/instantiator": "^1.0"
"doctrine/inflector": "^1.1|^2.0"
},
"require-dev": {
"phpunit/phpunit": "4.*",
Expand Down
185 changes: 129 additions & 56 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/FlexibleContentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace StoutLogic\AcfBuilder;

use Doctrine\Common\Inflector\Inflector;

/**
* Create a configuration array for an ACF Flexible Content field.
* A flexible content field can have many different `layouts` which are
* groups of fields.
*/
class FlexibleContentBuilder extends FieldBuilder
{
use Traits\CanSingularize;

/**
* @var array
*/
Expand Down Expand Up @@ -145,6 +145,6 @@ public function getLayouts()
*/
private function getDefaultButtonLabel()
{
return 'Add '.Inflector::singularize($this->getLabel());
return 'Add ' . $this->singularize($this->getLabel());
}
}
Loading

0 comments on commit 1fbdb58

Please sign in to comment.