@@ 119-130 (lines=12) @@ | ||
116 | * @param string $type |
|
117 | * @return bool |
|
118 | */ |
|
119 | public function hasAssetOfType($identifier, $type = Asset::TYPE_JS) |
|
120 | { |
|
121 | $this->rewind(); |
|
122 | while ($this->valid()) { |
|
123 | if ($this->getInfo() === $identifier && $this->current()->type() === $type) { |
|
124 | $this->rewind(); |
|
125 | return true; |
|
126 | } |
|
127 | $this->next(); |
|
128 | } |
|
129 | return false; |
|
130 | } |
|
131 | ||
132 | ||
133 | /** |
|
@@ 175-188 (lines=14) @@ | ||
172 | * @param string $type |
|
173 | * @return JavascriptAsset|StylesheetAsset |
|
174 | */ |
|
175 | public function getAssetOfType($identifier, $type = Asset::TYPE_JS) |
|
176 | { |
|
177 | $this->rewind(); |
|
178 | while ($this->valid()) { |
|
179 | if ($this->getInfo() === $identifier && $this->current()->type() === $type) { |
|
180 | /** @var JavascriptAsset|StylesheetAsset $object */ |
|
181 | $object = $this->current(); |
|
182 | $this->rewind(); |
|
183 | return $object; |
|
184 | } |
|
185 | $this->next(); |
|
186 | } |
|
187 | return null; |
|
188 | } |
|
189 | ||
190 | ||
191 | /** |