@param string $replacement
@param string $filePath

@return self
@SuppressWarnings(PHPMD.StaticAccess)
551368
public function replacePluralName(string $replacement, string $filePath): self
    {
        $this->findReplace(AbstractGenerator::FIND_ENTITY_NAME_PLURAL, $replacement, $filePath);
        $this->findReplace(\lcfirst(AbstractGenerator::FIND_ENTITY_NAME_PLURAL), \lcfirst($replacement), $filePath);
        $this->findReplace(
            \strtoupper(AbstractGenerator::FIND_ENTITY_NAME_PLURAL),
            \strtoupper($replacement),
            $filePath
        );
        $this->findReplace(
            \strtoupper(Inflector::tableize(AbstractGenerator::FIND_ENTITY_NAME_PLURAL)),
            \strtoupper(Inflector::tableize($replacement)),
            $filePath
        );

        return $this;
    }
1060184
public function addAttachment($filePath, $name = null)
    {
        $this->getMailer()->addAttachment($filePath, empty($name) ? pathinfo($filePath, PATHINFO_BASENAME) : $name);
        
        return $this;
    }
881607
public function move(string $newFolderPath): self
    {
        $newFolderPath = normalize_path($newFolderPath);

        if (!is_dir($newFolderPath)) {
            if (rename($this->path, $newFolderPath)) {
                return new self($newFolderPath);
            }
            throw new FolderException('Cannot move folder to the new folder path ('.$newFolderPath.') for unknown reasons');
        }
        throw new FolderException('Cannot move the folder, because the new folder path ('.$newFolderPath.') already exists',
            FolderException::ALREADY_EXIST);
    }
368110
public function setReplacement($replacement)
    {
        if (!is_array($replacement) && !is_string($replacement)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects replacement to be array or string; received "%s"',
                __METHOD__,
                (is_object($replacement) ? get_class($replacement) : gettype($replacement))
            ));
        }
        $this->options['replacement'] = $replacement;
        return $this;
    }
1346781
public static function move($sourcePath, $destinationPath)
    {
        if (!self::exists($sourcePath)) {
            throw new FileNotFoundException('Cannot find source file: ' . $sourcePath);
        }
        return rename($sourcePath, $destinationPath);
    }
97937
public function findReplace(
        string $find,
        string $replace,
        string $filePath
    ): self {
        $contents = \ts\file_get_contents($filePath);
        $contents = str_replace($find, $replace, $contents);
        file_put_contents($filePath, $contents);

        return $this;
    }
262415
public function extract($filePath)
    {
        $directory = $this->directory->getDirectoryPath();
        $pharArchive = new Phar($filePath);
        $pharArchive->extractTo($directory);

        return $this->createFinderFromDirectory($directory);
    }
708746
public function setFilepath(Path $filepath)
    {
        if ($this->filepath === null) {
            $this->filepath = $filepath;
        } else {
            $this->filepath->append($filepath);
        }
    }
847131
protected function postCopy(
        string $filePath
    ): void {
        $this->fileCreationTransaction::setPathCreated($filePath);
        $this->findAndReplaceHelper->replaceName(
            $this->codeHelper->classy($this->className),
            $filePath,
            FieldGenerator::FIND_ENTITY_FIELD_NAME
        );
        $this->findAndReplaceHelper->findReplace(
            $this->codeHelper->consty(FieldGenerator::FIND_ENTITY_FIELD_NAME),
            $this->codeHelper->consty($this->className),
            $filePath
        );
        $this->codeHelper->tidyNamespacesInFile($filePath);
        $this->setGetterToIsForBools($filePath);
    }
1119709
public static function createByFilePath($filepath) : Repository
    {
        $filename = basename($filepath);
        list($domain, $language, $extension) = explode('.', $filename, 3);

        $yamlParser = new YamlParser();
        $data = $yamlParser->parse(file_get_contents($filepath));

        $emptyArray = [];
        $translations = [];
        self::createPlainRepresentationByArray(
            $translations,
            $language,
            ($data) ?: [],
            $emptyArray,
            ''
        );

        $translationCollection = TranslationCollection::create($translations);

        return new self(
            $translationCollection,
            $filepath,
            $language,
            $domain
        );
    }
241987
public function replaceOne($document, $replacement, $options = [])
    {
        $query = new ReplaceOne($this->documentManager, $this, $document, $replacement, $options);
        if (isset($options['getQuery']) && $options['getQuery']) {
            return $query;
        } else {
            return $query->execute();
        }
    }
1161173
public static function bindings(string $filePath = null)
    {
        if (is_file($filePath)) {
            /** @noinspection PhpIncludeInspection */
            $bindings = require_once $filePath;

            $bindings = is_array($bindings) ? $bindings : [];

            IOC::addBindings($bindings);

            Event::dispatch('minimal.loaded.bindings', [$filePath, $bindings]);
        }
    }
815330
public function replaceLanguage($path, $language, $replacement = null)
    {
        $path = $this->stripLanguage($path, $language);
        $path = $this->prependLanguage($path, $replacement);

        return $path;
    }
8144
public function loadFile($filePath) {
        require_once (substr($filePath, 0, 1) != '/' && substr($filePath, 1, 1) != ':')
            ? $this->basePath . DIRECTORY_SEPARATOR . $filePath : $filePath;
    }
829539
public function syncWithTemplate($filePath, $overwrite = FALSE) {
    $sourcePath = $this->getBltRoot() . '/template/' . $filePath;
    $targetPath = $this->getRepoRoot() . '/' . $filePath;

    if ($this->getFileSystem()->exists($sourcePath)) {
      try {
        $this->getFileSystem()->copy($sourcePath, $targetPath, $overwrite);
      }
      catch (IOException $e) {
        throw $e;
      }
    }

  }
886661
public static function replaceWith($replacement): callable
    {
        return function (&$val) use ($replacement) : bool{
            if (empty($val)) {
                $val = $replacement;
            }

            return true;
        };
    }
875912
final public function createFile($filePath = null)
    {
        if (isset($filePath)) {
            $this->filePath = $filePath;
        }

        if (pathinfo($this->filePath, PATHINFO_EXTENSION) === '') {
            $this->filePath .= $this->fileExtension;
        }

        return $this;
    }