Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22397123
ArcanistComposerLinter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistComposerLinter.php
View Options
<?php
final
class
ArcanistComposerLinter
extends
ArcanistLinter
{
const
LINT_OUT_OF_DATE
=
1
;
public
function
getInfoName
()
{
return
pht
(
'Composer Dependency Manager'
);
}
public
function
getInfoDescription
()
{
return
pht
(
'A linter for Composer related files.'
);
}
public
function
getLinterName
()
{
return
'COMPOSER'
;
}
public
function
getLinterConfigurationName
()
{
return
'composer'
;
}
public
function
getLintNameMap
()
{
return
array
(
self
::
LINT_OUT_OF_DATE
=>
pht
(
'Lock file out-of-date'
),
);
}
public
function
lintPath
(
$path
)
{
switch
(
basename
(
$path
))
{
case
'composer.json'
:
$this
->
lintComposerJson
(
$path
);
break
;
case
'composer.lock'
:
break
;
}
}
private
function
lintComposerJson
(
$path
)
{
$composer_hash
=
md5
(
Filesystem
::
readFile
(
dirname
(
$path
).
'/composer.json'
));
$composer_lock
=
phutil_json_decode
(
Filesystem
::
readFile
(
dirname
(
$path
).
'/composer.lock'
));
if
(
$composer_hash
!==
$composer_lock
[
'hash'
])
{
$this
->
raiseLintAtPath
(
self
::
LINT_OUT_OF_DATE
,
pht
(
"The '%s' file seems to be out-of-date. "
.
"You probably need to run `%s`."
,
'composer.lock'
,
'composer update'
));
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 17:06 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1223125
Default Alt Text
ArcanistComposerLinter.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline