| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function onBeforeWrite() { |
||
| 37 | parent::onBeforeWrite(); |
||
| 38 | // Write the URLSegment to allow for Taxonomy navigation only if one is not supplied |
||
| 39 | if ($this->owner->Name && $this->owner->URLSegment == null) { |
||
| 40 | $this->owner->setField('URLSegment', SiteTree::singleton()->generateURLSegment($this->owner->Name)); |
||
| 41 | // Ensure that this object has a non-conflicting URLSegment value. |
||
| 42 | $count = 2; |
||
| 43 | while (TaxonomyTerm::get()->filter(['URLSegment' => $this->owner->URLSegment])->exclude(array('ID' => $this->owner->ID))->exists()) |
||
| 44 | { |
||
| 45 | $this->owner->setField('URLSegment', preg_replace('/-[0-9]+$/', null, $this->owner->URLSegment) . '-' . $count); |
||
| 46 | $count++; |
||
| 47 | } |
||
| 51 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths