Skip to content

Commit 38da555

Browse files
committed
Small changes suggested by Yaron
1 parent d2d3c2c commit 38da555

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

.github/instructions/mediawiki-extensions-clean-code.instructions.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ applyTo: "*"
88

99
Use the service container pattern (based on MediaWikiServices) to define how key objects are constructed and wired together.
1010

11+
Absolutely no MediaWikiServices references should be in the code because everything should be injected.
12+
1113
## Dependency injection
1214

1315
Use this example from PluggableAuth to implement dependency injection.
1416

17+
Objects should only be instantiated in `ServiceWiring.php`, not in any other file.
18+
1519
Below is an `includes/ServiceWiring.php` file.
1620

1721
```php
@@ -150,4 +154,4 @@ class PluggableAuthServiceTest extends MediaWikiIntegrationTestCase {
150154
}
151155

152156
}
153-
```
157+
```

extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"value": "HTTP/1.0 403 Forbidden"
4141
},
4242
"CrawlerProtectionRawDenialText": {
43-
"value": "403 Forbidden"
43+
"value": "403 Forbidden. You must be logged in to view this page."
4444
}
4545
},
4646
"ServiceWiringFiles": [

includes/CrawlerProtectionService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright (c) 2025 MyWikis
3+
* Copyright (c) 2025-2026 MyWikis
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal

includes/Hooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright (c) 2025 MyWikis
3+
* Copyright (c) 2025-2026 MyWikis
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal

includes/ResponseFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright (c) 2025 MyWikis
3+
* Copyright (c) 2025-2026 MyWikis
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal

includes/ServiceWiring.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright (c) 2025 MyWikis
3+
* Copyright (c) 2025-2026 MyWikis
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)