Skip to content

Commit

Permalink
Merge pull request #4 from lucascherifi/analysis-zGDRpO
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
Lucas CHERIFI committed Apr 10, 2016
2 parents baa2ade + ee43d53 commit eb5db0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/PdfParserExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
new FileLocator(__DIR__ . '/../Resources/config')
);
$loader->load('services.yml');
}
Expand Down
12 changes: 6 additions & 6 deletions PdfParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private function doParse($data)

$endPos = $this->findPosition($data, $this->processorConfiguration['endConditions']);
if (is_null($endPos)) {
throw new Exception('End condition not reached at the '.(count($blocks) + 1).'nth loop of block.');
throw new Exception('End condition not reached at the ' . (count($blocks) + 1) . 'nth loop of block.');
} else {
$blockData = substr($data, 0, $endPos);
$data = substr($data, $endPos);
Expand Down Expand Up @@ -347,7 +347,7 @@ private function mergeRows($row, $newRow)
{
foreach ($newRow as $newRowColumnIndex => $newRowColumnValue) {
if (strlen($newRowColumnValue)) {
$row[$newRowColumnIndex] = trim($row[$newRowColumnIndex]."\n".$newRowColumnValue);
$row[$newRowColumnIndex] = trim($row[$newRowColumnIndex] . "\n" . $newRowColumnValue);
}
}

Expand All @@ -361,14 +361,14 @@ private function mergeRows($row, $newRow)
*/
private function getTextVersion($filePath)
{
$tmpPath = $this->temporaryDirectoryPath.'/'.rand(0, 10000).'.txt';
$process = new Process('/usr/bin/pdftotext -layout '.$filePath.' '.$tmpPath);
$tmpPath = $this->temporaryDirectoryPath . '/' . rand(0, 10000) . '.txt';
$process = new Process('/usr/bin/pdftotext -layout ' . $filePath . ' ' . $tmpPath);
$this->logger->info('Execute Pdftotext', ['file' => $filePath]);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
echo 'ERR > ' . $buffer;
} else {
echo 'OUT > '.$buffer;
echo 'OUT > ' . $buffer;
}
});

Expand Down
2 changes: 1 addition & 1 deletion Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
if (!($loader = @include __DIR__.'/../vendor/autoload.php')) {
if (!($loader = @include __DIR__ . '/../vendor/autoload.php')) {
echo <<<'EOT'
You need to install the project dependencies using Composer:
$ wget http://getcomposer.org/composer.phar
Expand Down

0 comments on commit eb5db0f

Please sign in to comment.