Skip to content

Enhancement: Enable and configure header_comment fixer #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

$header = <<<TXT
Any ideas?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗


@see https://github.com/php/web-php
TXT;

$finder = PhpCsFixer\Finder::create()->in(__DIR__);

$config = new PhpCsFixer\Config();
Expand All @@ -20,6 +26,10 @@
->setRules([
'array_indentation' => true,
'constant_case' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
],
'indentation_type' => true,
'line_ending' => true,
'no_extra_blank_lines' => true,
Expand Down
7 changes: 7 additions & 0 deletions archive/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

include_once __DIR__ . '/../include/prepend.inc';
$i = 0;
do {
Expand Down
5 changes: 4 additions & 1 deletion autoload.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

/**
* @see https://github.com/php-fig/fig-standards/blob/a1a0674a742c9d07c5dd450209fb33b115ee7b40/accepted/PSR-4-autoloader-examples.md#closure-example
* Any ideas?
*
* @see https://github.com/php/web-php
*/

spl_autoload_register(static function (string $class): void {
$prefix = 'phpweb\\';
$directory = __DIR__ . '/src/';
Expand Down
8 changes: 7 additions & 1 deletion backend/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php
// Simulate a /backend shortcut call (which will lead to a manual page)

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$_SERVER['REQUEST_URI'] = '/backend';
include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../error.php';
8 changes: 7 additions & 1 deletion bin/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php
// Simulate a /bin shortcut call (which will lead to a manual page)

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$_SERVER['REQUEST_URI'] = '/bin';
include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../error.php';
14 changes: 5 additions & 9 deletions cached.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?php
/*
Yes, we know this can be used to view the source for any file
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably makes sense to keep these, but move them.

in the docroot directory. This is intentional and not an LFI
vulnerability. The source code for everything in the docroot
is publicly available at

https://github.com/php/web-php
/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

so there is no vulnerability here. You can't use this to view
anything that is private.
*/
$_SERVER['BASE_PAGE'] = 'cached.php';
include_once 'include/prepend.inc';

Expand Down
7 changes: 7 additions & 0 deletions conferences/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$_SERVER['BASE_PAGE'] = 'conferences/index.php';
include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../include/pregen-news.inc';
Expand Down
7 changes: 7 additions & 0 deletions credits.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$_SERVER['BASE_PAGE'] = 'credits.php';
include_once __DIR__ . '/include/prepend.inc';

Expand Down
13 changes: 5 additions & 8 deletions error.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php
/*

This script handles all 401, 403 and 404 error redirects,
and some directory requests (like /images). Uses the
preferred language setting and the REQUEST_URI to guess what
page should be displayed. In case there is no page that can
be displayed, the user is redirected to a search page.

*/
/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

// Ensure that our environment is set up
include_once __DIR__ . '/include/prepend.inc';
Expand Down
7 changes: 7 additions & 0 deletions images/elephpants.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

include_once __DIR__ . '/../include/prepend.inc';

$now = $_SERVER["REQUEST_TIME"];
Expand Down
8 changes: 7 additions & 1 deletion images/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php
// Simulate a /images shortcut call (which will lead to a manual page)

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$_SERVER['REQUEST_URI'] = '/images';
include_once __DIR__ . '/../include/prepend.inc';
include_once __DIR__ . '/../error.php';
6 changes: 6 additions & 0 deletions images/logo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$refresh = isset($_GET['refresh']);

// Be 100% sure the timezone is set
Expand Down
7 changes: 7 additions & 0 deletions include/branches.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

include_once __DIR__ . '/releases.inc';
include_once __DIR__ . '/version.inc';

Expand Down
7 changes: 7 additions & 0 deletions include/changelogs.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

function bugfix($number) {
echo "Fixed bug "; bugl($number);
}
Expand Down
7 changes: 7 additions & 0 deletions include/countries.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

return array(
'AFG' => 'Afghanistan',
'ALB' => 'Albania',
Expand Down
10 changes: 5 additions & 5 deletions include/do-download.inc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/*
This code redirects the user to the exact file to
download, and logs the download if it's something
we would like to know about (PHP binary or source).
*/
/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

function get_actual_download_file($file)
{
Expand Down
7 changes: 6 additions & 1 deletion include/email-validation.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?php

// Try to remove anti-SPAM bits
/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

function clean_AntiSPAM($email)
{
$remove_spam = "![-_]?(NO|I[-_]?HATE|DELETE|REMOVE)[-_]?(THIS)?(ME|SPAM)?[-_]?!i";
Expand Down
11 changes: 6 additions & 5 deletions include/errors.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
/*
This script provides functions to print out
error messages for users in case something is
not available.
*/

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

// A 'good looking' 404 error message page
function error_404()
Expand Down
7 changes: 7 additions & 0 deletions include/historical_mirrors.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$historical_mirrors = array(
array("ARG", "ar2.php.net", "XMundo Hosting Solutions", "http://www.xmundo.net"),
array("ARM", "am1.php.net", "ARMINCO Global Telecommunications", "http://www.arminco.com/"),
Expand Down
8 changes: 7 additions & 1 deletion include/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php
// Simulate a /include shortcut call (which will lead to a manual page)

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$_SERVER['REQUEST_URI'] = '/include';
include_once __DIR__ . '/prepend.inc';
include_once __DIR__ . '/../error.php';
8 changes: 7 additions & 1 deletion include/ip-to-country.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php // -*- C++ -*-
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

/*

Expand Down
8 changes: 7 additions & 1 deletion include/langchooser.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php // -*- C++ -*-
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

/*

Expand Down
8 changes: 7 additions & 1 deletion include/languages.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php // -*- C++ -*-
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

/*
This is a list of all manual languages hosted
Expand Down
8 changes: 7 additions & 1 deletion include/manual-lookup.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php // -*- C++ -*-
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

// We need this for error reporting
include_once __DIR__ . '/errors.inc';
Expand Down
10 changes: 5 additions & 5 deletions include/posttohost.inc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/*
This code is used to post data to the central server which
can store the data in database and/or mail notices or requests
to PHP.net stuff and servers
*/
/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

function posttohost($url, $data)
{
Expand Down
7 changes: 7 additions & 0 deletions include/releases.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

$OLDRELEASES = array (
8 =>
array (
Expand Down
7 changes: 7 additions & 0 deletions include/results.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

function search_results($res, $q, $profile='all', $per_page=10, $s=0, $l='en', $show_title=true, $show_foot=true, $show_attrib=true) {
$start_result = $s;
$end_result = $s + $res['ResultSet']['totalResultsReturned'] -1;
Expand Down
8 changes: 7 additions & 1 deletion include/shared-manual.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php // -*- C++ -*-
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

/*

Expand Down
8 changes: 7 additions & 1 deletion include/site.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php // -*- C++ -*-
<?php

/**
* Any ideas?
*
* @see https://github.com/php/web-php
*/

// Define some constants, and $MIRRORS array
// Mirror type constants
Expand Down
Loading