1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-16 19:36:59 +01:00
psalm/src/Psalm/Provider/FileProvider.php
2017-09-16 12:45:20 -04:00

47 lines
839 B
PHP

<?php
namespace Psalm\Provider;
class FileProvider
{
/**
* @param string $file_path
*
* @return string
*/
public function getContents($file_path)
{
return (string)file_get_contents($file_path);
}
/**
* @param string $file_path
* @param string $file_contents
*
* @return void
*/
public function setContents($file_path, $file_contents)
{
file_put_contents($file_path, $file_contents);
}
/**
* @param string $file_path
*
* @return int
*/
public function getModifiedTime($file_path)
{
return (int)filemtime($file_path);
}
/**
* @param string $file_path
*
* @return bool
*/
public function fileExists($file_path)
{
return file_exists($file_path);
}
}