function OperationFactory::hasContent
Same name in other branches
- 8.9.x composer/Plugin/Scaffold/Operations/OperationFactory.php \Drupal\Composer\Plugin\Scaffold\Operations\OperationFactory::hasContent()
- 10 composer/Plugin/Scaffold/Operations/OperationFactory.php \Drupal\Composer\Plugin\Scaffold\Operations\OperationFactory::hasContent()
- 11.x composer/Plugin/Scaffold/Operations/OperationFactory.php \Drupal\Composer\Plugin\Scaffold\Operations\OperationFactory::hasContent()
Checks to see if the specified scaffold file exists and has content.
Parameters
Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath $file: Scaffold file to check.
Return value
bool True if the file exists and has content.
1 call to OperationFactory::hasContent()
- OperationFactory::createAppendOp in composer/
Plugin/ Scaffold/ Operations/ OperationFactory.php - Creates an 'append' (or 'prepend') scaffold op.
File
-
composer/
Plugin/ Scaffold/ Operations/ OperationFactory.php, line 131
Class
- OperationFactory
- Create Scaffold operation objects based on provided metadata.
Namespace
Drupal\Composer\Plugin\Scaffold\OperationsCode
protected function hasContent(ScaffoldFilePath $file = NULL) {
if (!$file) {
return FALSE;
}
$path = $file->fullPath();
return is_file($path) && filesize($path) > 0;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.