@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @param bool $mbSupport |
| 22 | 22 | * Turn multi byte support on or off |
| 23 | 23 | * |
| 24 | - * @return Document |
|
| 24 | + * @return \Sabberworm\CSS\CSSList\Document |
|
| 25 | 25 | * A parsed CSS document object |
| 26 | 26 | */ |
| 27 | 27 | public static function build($file, $mbSupport = false) { |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | |
| 8 | 8 | use Sabberworm\CSS\Parser; |
| 9 | 9 | use Sabberworm\CSS\Settings; |
| 10 | -use Katten\Purge\Exceptions\UnableToReadInFileException; |
|
| 11 | 10 | |
| 12 | 11 | |
| 13 | 12 | class CssDocumentFactory extends FileFactory { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * A local file path or remote url |
| 20 | 20 | * |
| 21 | 21 | * @return |
| 22 | - * A Dom object with the HTML parsed |
|
| 22 | + PurgeHtmlCrawler A Dom object with the HTML parsed |
|
| 23 | 23 | */ |
| 24 | 24 | public static function build($file) { |
| 25 | 25 | |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | use Katten\Purge\PurgeHtmlCrawler; |
| 9 | -use Katten\Purge\Exceptions\UnableToReadInFileException; |
|
| 10 | 9 | |
| 11 | 10 | |
| 12 | 11 | class DomFactory extends FileFactory { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $this->outputSummary($purgeManager->getPurgeResults()); |
| 49 | 49 | } |
| 50 | - catch ( \Exception $e ) { |
|
| 50 | + catch (\Exception $e) { |
|
| 51 | 51 | |
| 52 | 52 | $type = get_class($e); |
| 53 | 53 | $this->output->writeln(''); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $this->output->writeln(' [<info>OK</info>]'); |
| 81 | 81 | |
| 82 | - $this->html = [ $this->input->getArgument('html') ]; |
|
| 82 | + $this->html = [$this->input->getArgument('html')]; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | $purgeManager->startPurge($this->html); |
| 47 | 47 | |
| 48 | 48 | $this->outputSummary($purgeManager->getPurgeResults()); |
| 49 | - } |
|
| 50 | - catch ( \Exception $e ) { |
|
| 49 | + } catch ( \Exception $e ) { |
|
| 51 | 50 | |
| 52 | 51 | $type = get_class($e); |
| 53 | 52 | $this->output->writeln(''); |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | |
| 112 | 112 | if (strstr($selector, ':')) { |
| 113 | 113 | $processedSelector = preg_replace('/\([^()]+\)|::?[^ ,:.(]+/i', '', $selector); |
| 114 | - } |
|
| 115 | - else { |
|
| 114 | + } else { |
|
| 116 | 115 | $processedSelector = $selector; |
| 117 | 116 | } |
| 118 | 117 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | try { |
| 32 | 32 | |
| 33 | 33 | $xPath = CssSelector::toXPath($selector); |
| 34 | - $xPath = '(' . $xPath . ')[1]'; |
|
| 34 | + $xPath = '('.$xPath.')[1]'; |
|
| 35 | 35 | |
| 36 | 36 | return $this->filterXPath($xPath); |
| 37 | 37 | } |
@@ -34,8 +34,7 @@ |
||
| 34 | 34 | $xPath = '(' . $xPath . ')[1]'; |
| 35 | 35 | |
| 36 | 36 | return $this->filterXPath($xPath); |
| 37 | - } |
|
| 38 | - catch (ParseException $e) { |
|
| 37 | + } catch (ParseException $e) { |
|
| 39 | 38 | |
| 40 | 39 | throw new ParseException("{$e->getMessage()} Invalid Selector: $selector"); |
| 41 | 40 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | foreach ($css->getAllDeclarationBlocks() as $block) { |
| 41 | 41 | $hash = $this->hashBlock($block); |
| 42 | 42 | |
| 43 | - $this->hashTable[$hash] = [ self::BLOCK_VALUE => $block, self::IS_USED => false ]; |
|
| 43 | + $this->hashTable[$hash] = [self::BLOCK_VALUE => $block, self::IS_USED => false]; |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $hash = $this->hashBlock($block); |
| 123 | 123 | |
| 124 | - $this->hashTable[$hash] = [ self::BLOCK_VALUE => $block, self::IS_USED => $value ]; |
|
| 124 | + $this->hashTable[$hash] = [self::BLOCK_VALUE => $block, self::IS_USED => $value]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |