modules/Calendar/models/ExportToIcal.php
Avoid using static access to class '\App\Integrations\Dav\Calendar' in method 'output'. Open
Open
$calendar = \App\Integrations\Dav\Calendar::createEmptyInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Declaration of function sanitizeValues($arr) : array
should be compatible with function sanitizeValues(array $recordValues) : array
(parameter #1 with no type cannot replace original parameter with type 'array')
defined in /code/app/Export/Records.php:300
Open
Open
public function sanitizeValues($arr): array
- Exclude checks
Call to method serialize
from undeclared class \Sabre\VObject\Component\VCalendar
Open
Open
echo $calendar->getVCalendar()->serialize();
- Exclude checks
Call to undeclared method \App\Db\Query::all
Open
Open
$this->output([], $this->getExportQuery()->all());
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Calendar_ExportToIcal_Model extends \App\Export\Records
- Exclude checks
The class Calendar_ExportToIcal_Model is not named in CamelCase. Open
Open
class Calendar_ExportToIcal_Model extends \App\Export\Records
{
/** {@inheritdoc} */
protected $fileExtension = 'ics';
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $fileExtension = 'ics';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function exportData()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$calendar->loadFromArray($row);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$calendar->createComponent();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function output($headers, $entries)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getExportContentType(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->output([], $this->getExportQuery()->all());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return 'text/calendar';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo $calendar->getVCalendar()->serialize();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function sanitizeValues($arr): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $arr;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$calendar = \App\Integrations\Dav\Calendar::createEmptyInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ($entries as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Class name "Calendar_ExportToIcal_Model" is not in camel caps format Open
Open
class Calendar_ExportToIcal_Model extends \App\Export\Records
- Exclude checks